Not having to recreate objects?

Started by
5 comments, last by xyuri 19 years, 2 months ago
I have been playing around with the basics of OpenGL for a little while now ... but I am wondering, like in large games such as Doom3 they dont have to go through a coordinate array every cycle to redraw the world do they? is there a way to draw an object from data but not have to do through the data again to redraw the object? I have read through parts of the red book and google to find out but dont seem to find anything that makes sense to me inreguards to this exact problem. Any help is appreciated, Thanks :-)
__________Michael Dawson"IRC is just multiplayer notepad." - Reverend
Advertisement
Many many ways to solve this (ordered from oldest to latest, linked to random google output):
- Display lists
- Vertex Arrays
- Vertex Buffer Objects

Have fun,
Pat

well i dont no exactly wat u mean but in games like that, they only draw wat u see. Lets say ur in a room, all that would be rendered would be that room nothing behind u or past it. So this way, it would not draw the entire world which would lag like a mother with FSAA and anisotropic filtering all at max settings with a res of 1600x1200.
Quote:Original post by xyuri
I have been playing around with the basics of OpenGL for a little while now ... but I am wondering, like in large games such as Doom3 they dont have to go through a coordinate array every cycle to redraw the world do they?
Yep, they do. That's not to say that they do all those glVertex calls each frame like you do; they're more likely to use display lists, vertex arrays, and/or VBOs. I suggest that you read up on those options.

EDIT: so, darookie becomes damaster! CURSES!
Basically, what doom III and other games do is something called "instancing" which means they keep the same model data (what i assume your referring to as coordinates) and retransform it, using matrices, like in the simplest of cases:

while (true)
{
//message handling

for (UINT i = 0; i < NumInstances; ++i)
{
glTranslatef(Instances.Position.x, Instances.Position.y, Instances.Position.z);
DrawModel(Models[Instances.ModelIndex]);
}
}

you know, something like that, so its the same model, multiple instances can have the same model, but different Positions

EDIT: not only was i beaten, but i guess i misinterpreted the question, lol

hope that helps
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Quote:Original post by Sneftel
EDIT: so, darookie becomes damaster! CURSES!

[evil]
Thank you all for youre very fast responses ! At least now I know what OpenGL stuff I need to search for to get this effect happening :-)

Thanks again :-)
__________Michael Dawson"IRC is just multiplayer notepad." - Reverend

This topic is closed to new replies.

Advertisement