hackorama
hackorama
3D Gfx concepts for understanding Performer [ Kishan Circa 1999 ]


3D has depth so points are defined by x y and z.

So any point in space can be defined by xyz. So all the 3D gfx objects are basically objects in this 3D space defined by xyz points.

The center or reference point of the 3D space is the origin at 0,0,0.

3 and more points make polygons

simplest polygon is a triangle

any polygon can be broken down into triangles

triangles form the basic building block of 3D graphics.

non triangular polygons can also be used to build 3d models

these polygons builds the skeleton of the models.

to make them look good you need to color the polygons, and to make them more realistic you define the material properties. like how does it reflect light and whether it is transparent or not. ( a plastic object and a chrome object looks totally differnt in terms of its reflective properties )

Then to make it even better you need to define the textures. like the designs on a carpetted floor.

So you define points whch makes up polygons and then you define the color, material properties and textures to build 3D gfx objects or models.

Once you create the objects you have to view them. For that you put an eye into the 3D world you created which is called either eyepoint or camera.

Like your eye you can look at any point in space. so you define where you look-at, by setting the eye point in the 3d space you created.

The eye point is defined by xyz the position of the eye and h,p,r the angles you are looking at.

h-heading p-pitch r-roll or hpr will define whether you are looking up , down side ways etc.
hpr defines the 3 angles which are rotations around the three axes xyz.

So you create the 3D world ( using points, polygons colors material and texture ) at certain positions in the 3D space and then you put an eye in that space and positions the eye apropriately so that you can see that model.

OK the model is ready and viewed using the eye point. How do you get different views of the model change the position of the eye/camera.

How do you make the model to change like a car that moves. You have to change each and every point that defines the car.

The changes you do to the models to make it move are defined by transformations and rotations. So you can postion a 3D object at any position ( xyz ) and at any angle ( hpr) by applying transformations and rotation. Imagine a table and a soda can on it if you just move the soda can on the table to a new position it is a transformation. But if you turn the can to see the brandname then its a roataion. And if you roll the can on the table then its a transforamtion and rotation combined. So whichever way you place or move the soda can on the table, it can be defined by a transformation and roataion.

So these are the basic things that define a 3D gfx space. models camera and transformations rotations to define movements of camera and objects.

One more thing you need is the lights to define how do you see the objects is it very bright or dark how many lights You also have special lights like spot lights.

Usually you use a general ( light like sun ) which lights up everything on the scene.

You can use any 3D gfx API to create a 3D scene using the above concepts like OpenGL, Direct3D.

These API's have calls that will allow you to create 3D scenes as defined as polygons in a 3D space and viewed through an eye/camera.

Performer is an API built on top of OpenGL to make the creation and more importantly the interaction and updation of the 3D scene easier and compact.

Also Performer allows you to separate the 3D objects from the performer program and store them in a separate file called 3D database files ( or models ).

So you can either create the objects using the API calls as a set of polygons. Or you can create the objects separately using special editing software and store the models in 3D database file formats. Performer has special program called loaders which will read through these 3D models and create the required polygons inside Performer.

In a typical Performer application like visual simulation of a fighter aircraft.

You need to have the runway and the airport and other aircrafts as the 3D objects.

You create them using a 3D modeling or editing tool like Multigen. And save the 3D database file in openflight ( .flt ) format.

In your Performer application you load the multigen created 3D database file of the runway and airport into the performer 3D scene and you define a channel ( eye/camera ) into the scene.

you change the view of the channel to respond to the view of the pilot. This is defined by your simulation application which updates the pilots view to show where you are flying.

You also load the other aircraft models defined as 3D database files into the scene and change there position depending on where they are flying to.

So your simualtion applications uses Performer API to define the view of the pilot inside a fighter and the positions of the other air crafts to simulate a fighter aircraft simualation.

Scene is the 3D space where the objects are loaded Channel is the view into the scene like the eye/camera



Sample Code

1. HellCube
2. HelloTeapot


LINKS

1.IRIS Performer
2.SGI


Monday, 14-Jan-2002 01:14:04 PST kishan at hackorama dot com