Hi all, it seems that display list, vertex arrays can only be used to speed up the drawing of static model. Is it so? If so, is there any way to speed up the drawing of moving 3ds model such as moving cars?
Thx a lot
04-12-2004, 08:38 AM
vertex arrays can have dynamic meshes as well, its just a quicker way of drawing instead of doing those glVertex... commands
just like any array you can change the content, and when you draw the array it will use what is in there.
display lists can be used for mvoing things as well. It just means that "within the list nothing can move"
like if you want to move the car, the car body would be a display list, and one wheel would be a dlist.
when you call a list it will be positioned/ scaled/ rotated like where you are at the moment.
so lets say you have stored your carbody and carwheel display lists already you could make a function like this the numbers are of course just dummys
// move up a bit for the body
// place the wheels
now in your main render function you could do like
whereas x would be a global variable, your car would then move every frame a bit, this is not ideally since its speed would depend on how often you render the image...
you could just as well throw the whole car into a display list, but with splitting the wheels you could extend your drawcar() function to make the wheels spin.
so display lists can be used for animating things that dont change their topology, ie. if you wanted to crash your car and get deformations, you couldnt do it with display lists.
but vertex arrays you can deform freely
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.