Docsity

Collision Detection - E-Commerce - Lecture Slides, Slides of Fundamentals of E-Commerce

Partial preview of the text

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

3D Graphics - Further Topics(Brief Overviews) Tips for speeding up OpenGLZ-BufferingBlobby ModellingCollision DetectionRay Tracing

A few tips in OpenGL

Polygons are slow.

The more polygons in your scene, the more processing yourscene demands. Less polygons = faster rendering.

Depth of field is expensive.

gluPerspective(45, 1, 0.01, 1000)



gluPerspective(45, 1, 1, 100)



The second will look

much

nicer than the first, because from

0.01 to 1000 is 10

to 10

3

; that’s five orders of magnitude.

Whereas from 1 to 100 is from 10

0

to 10

2

; much less range,

so GL can store more z-buffer detail about the smaller range.

Matrix operations are slow.

Matrix operations--especially inversions--are slow andexpensive. Avoid them when possible.

A few tips in OpenGL

Display lists:

void render(void){

static

GLuint n =

if (!n) {

n = glGenLists(1);glNewList(n, GL_COMPILE_AND_EXECUTE);glutWireSphere(1,10,10);...glEndList(); } else

glCallList(n);

A few tips in OpenGL

Z-Buffering

When you render, you draw pixels onto a big 2D array of colorvalues (the screen).



Each pixel comes from a polygon on an object somewhere.



That spot on that object is a certain distance from the camera.



A

Z-buffer

is a 2D array, the same size as the screen, of

distances from the camera. For each pixel on the screen, a z-buffer stores how far away the spot that generated that pixelwas.



When a new polygon is drawn over an older one, the z-buffervalues are compared for each pixel. Only those pixels wherethe new color comes from a closer distance are drawn.



That’s how objects occlude one another.

Blobby Modelling

“Metaball, or ‘Blobby’, Modelling is a techniquewhich uses implicit surfaces to produce modelswhich seem more ‘organic’ or ‘blobby’ thanconventional models built from flat planes andrigid angles”.

--me

Uses of blobby modelling:

Organic forms and nonlinear shapes



Scientific modelling (electron orbitals, some medical imaging)



Muscles and joints with skin



Rapid prototyping



CAD/CAM solid geometry

Blobby Modelling Examples--

Paul Bourke(1997)

Blobby Modelling Examples--

“Cabrit Model” - Wyvill

How does it work?

The user controls a set of

control points

instead

of working directly with the surface. The controlpoints in turn influence the shape of the model.

Each point in space generates a field of force, which drops offas a function of distance from the point; like gravity weakeningwith distance.



A blobby model is formed from the shells of these force fields,the implicit surface which they define in space.



An

implicit surface

is a surface consisting of all the points in

space where a mathematical function (in this case, the valueof the force field) has a particular key value (such as 0.5).

Force = 2

1 0.5 0. ...