Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


use glTranslate for each primitive?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Gammastrahler   Members   -  Reputation: 150

Like
Likes
Like

Posted 22 June 2001 - 12:01 PM

hello again, for my ego-shooter engine, i currently use one call to glTranslate() to move through my 3d-world. this is pretty simple, but on the other side, i need to specify the absolute coordinates for every polygon in 3d space which can be annoying... since i need to readjust 10 times in many cases..... but i wan´t to rewrite my engine so that every polygon hold a x,y,z val for position and only the dimensions in relative units. this would mean that i have to call glTranslate() for every polygon. but i think it could slow down the game, because the matrix would be recalculated for every poly each frame.... any idea? thanks & greets gammastrahler

Sponsor:

#2 Obelix   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 June 2001 - 12:34 PM

quote:
Original post by Gammastrahler
but i wan´t to rewrite my engine so that every polygon hold a x,y,z val for position and only the dimensions in relative units. this would mean that i have to call glTranslate() for every polygon.


You are talking about polygons. Do you not use models?
It seems like you are moving by using glTranslate and that can also be little confusing.

Some pseudo code for the standard way:

glLoadIdentity();
gluLookAt(...); // move here
for(allModels) {
glPushMatrix();
translateAndRotateModelToTheProperPlace(...);
drawModel(...);
glPopMatrix();
}





#3 Gammastrahler   Members   -  Reputation: 150

Like
Likes
Like

Posted 22 June 2001 - 12:49 PM

@obelix:

no, i´m currently using no models, all polygons i use are coded coordinate by coordinate in c++.

the pseudo-code you stated is exactly what i mean, but as i said, you must translate and rotate for each model or poly, and i think that would slow down the engine, does it?

thanks
gammastrahler!

#4 Obelix   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 June 2001 - 09:24 PM

Yes, it would slow down the engine if you called it for each polygon. A model has many polygons so it does not make any difference. You can always write a function that transform your new format to absolute vertex coordinates. I think that you should write a editor before you get mad by hardcoding everything.
Perhaps can a editor made for another game like Quake be used?

#5 Slinger   Members   -  Reputation: 122

Like
Likes
Like

Posted 24 June 2001 - 07:24 PM

Why dont you use gluLookAt(); instead of translating and rotating your scene.

#6 AIRmichael   Members   -  Reputation: 136

Like
Likes
Like

Posted 27 June 2001 - 12:20 AM

What about useing glTranslate to every vertex instead of every polygon




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS