Docsity

Octrees - E-Commerce - Lecture Slides, Slides of Fundamentals of E-Commerce

Toggle sidebar
bg1
How does it REALLY work?
Introducing : Octrees.
ī˜‚An Octree is a recursive subdivision of space which ā€œhomes
inā€ on the surface, from larger to finer detail. As the Octree
subdivides and splits into smaller Octrees, only the Octrees
which contain some of the surface are processed; empty
Octrees are discarded.
ī˜‚An octree encloses a cube in space. You evaluate the force
function F(r) at each vertex of the cube.
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Octrees - E-Commerce - Lecture Slides and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

How does it REALLY work?

Introducing :

Octrees

An Octree is a recursive subdivision of space which ā€œhomesinā€ on the surface, from larger to finer detail. As the Octreesubdivides and splits into smaller Octrees, only the Octreeswhich contain some of the surface are processed; emptyOctrees are discarded.  An octree encloses a cube in space. You evaluate the forcefunction F(r) at each vertex of the cube.

How does it REALLY work?

To display a set of Octrees, you need to convertthe Octrees into polygons.

Each corner of each Octree has a value for the force function.  If some corners are ā€œhotā€ (above the force limit) and othersare ā€œcoldā€ (below the force limit) then the implicit surface must cross the cube edges in between.  You can draw triangles and polygons from the edges that thesurfaces crosses. This turns an Octree into a polygon whichcan be rendered. 

To refine the polygonalization, you subdivide thecube into eight subcubes, discarding any childwhose vertices are all hot or all cold.

Smoothing the surface

Improved edge vertices

The naive implementation is to form polygons whose verticesare the midpoints of the edges which lie between hot and coldvertices.  A dramatic smoothing effect can be achieved by using therelative strength of the hot and cold corners to determinewhether the intersection point should really fall closer to hot orto cold. The vertices of the polygon can be more closelyaproximated by points linearly interpolated along the edges ofthe cube. t = (0.5 - F(P1)) / (F(P2) - F(P1))P = P1 + t * (P2 - P1)

Octree refinement in action

Blobby Modelling

Some sources for further inspiration:

 http://astronomy.swin.edu.au/~pbourke/modelling/implicitsurf/  http://www.cs.berkeley.edu/~job/Papers/turk-2002-MIS.pdf  http://www.unchainedgeometry.com/jbloom/papers/interactive.pdf  http://www-courses.cs.uiuc.edu/~cs319/polygonization.pdf  http://bentonian.com/YAMM

Collision Detection (redux)

There are a number of different approaches tocollision detection. Which one you use willdepend on how much accuracy you need.

Sample cases:

Lasers shooting at a spaceship  Character walking through a maze  Billiard balls colliding  Fitting pieces together in CAD software

Collision Detection

Angled intesections

Finding the angle and point of intersection between movingspheres:  Solve for the point on the line of travel which is precisely thesum of the two spheres’ radii away from the center of thestationary sphere.  Subtracting the stationary sphere’s center from the point ofintersection will also give you the vector that is each sphere’snormal at the impact point.

Collision Detection

Being shot with a laser:

If your game character is being shot at, you may not carewhether their head or foot is hit. So don’t test them.  You can often reduce a player character to a cylinder.Testing for the intersection between a ray (the line of fire of agun) and a cylinder (the player) is really just a test of thedistance between two lines. Test the distance between theline and the axis of the cylinder.  If all fire is known to be horizontal, you can ignore the Y valuecompletely and reduce the problem to a line/circle test.