Giter Site home page Giter Site logo

cg1's Issues

update sphere function (spherical coordinate representation) and generalize it to support partial spheres

  1. Transform this function $f(\theta,\phi)$ into a function $f(u,v)$ over $[0,1]^2$ and generalize it to support partial spheres that only sweep out $\theta \in [\theta_{\text{min}},\theta_{\text{max}}]$ and $\phi \in [0,\phi_{\text{max}}]$ with the substitution
$$\begin{array}{lcl} \phi & = &u\,\,\phi_{\text{max}}\\\theta&=&\theta_{\text{min}}+v\,\,(\theta_\text{max}-\theta_{\text{min}}).\end{array}$$

The sphere’s extent can be truncated in two different ways. First, minimum and maximum $z$ values may be set; the parts of the sphere below and above these planes, respectively, are cut off. Second, considering the parameterization of the sphere in spherical coordinates, a maximum $\phi$ value can be set. The sphere sweeps out $\phi$ values from $0$ to the given $\phi_{\text{max}}$ such that the section of the sphere with spherical $\phi$ values above $\phi_{\text{max}}$ is also removed.

\\=== Sphere private data:
	const float radius;
	const float z_min, z_max;
	const float theta_min, theta_max, phi_max;

Implement intersection with other shapes, such as triangles and planes.

Assume that the plane object is a square with 2 unit length edges. It is placed at the origin and the plane normal is aligned with the positive z-axis in object coordinates. In future project we will be able to modify the size of the plane as well as to place it anywhere in the scene by means of geometric transformations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.