Help!

onesvenus

Newcomer
Hi, I'm trying to draw a moving car and I'm having problems.
What I want to do is to draw a car and that when I press left or right on the keyboard the wheels turn.
I've a .3ds model of about 15000 polys with 4 meshes (each one in a display list), the first two are the front and left wheels (about 2000 polys each one), another one are the back wheels (about 4000 polys), and another one is the body of the car (about 7000 polys).

Using an advice someone gave me on this forum, I draw the car using display lists and it gave a boost in performance but that was before I wanted the wheels to turn (It was all the car in one display list). In order to rotate the wheels I needed to know which polys were on the wheels, and that is why I divided the model on 4 meshes. And here is where I have some problems, while I only get like 18 fps if I draw two cars each with its own rotating wheels using display lists, I get like 45 fps using the inmediate mode.

If I'm not wrong this can be caused because when the video memory is full. When I'm trying to draw a display list that is not in video memory it has to be loaded on the memory. But how can I know how much memory I'm using?

The code I'm using to draw each car is something like this:

Code:
Push Matrix
Translate to the origin
Rotate amount X
Translate to destination
Draw the front left wheel (using a call to glCallList(idLW) or using glBegin()...glEnd())
Pop Matrix
Push Matrix
Translate to the origin
Rotate amount X
Translate to destination
Draw the front right wheel (using a call to glCallList(idRW) or using glBegin()...glEnd())
Pop Matrix
Push Matrix
Draw the back wheels (using a call to glCallList(idBW) or using glBegin()...glEnd())
Pop Matrix
Draw the body of the car (using a call to glCallList(idBody) or using glBegin()...glEnd())

Any help?
Thanks!

P.D:Feel free to tell me how wrong my code is, I'm trying to learn :p
 
im no coder but sourceforge has a number of opensource racing sims
i bet you could find your answers there....
 
Back
Top