• Advertisement

Archived

This topic is now archived and is closed to further replies.

Rendering Large amounts of blocks

This topic is 5832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am kind of trying to replicate gta's system, where everything is in a huge amount of blocks. I have managed to setup a system whereby only the blocks on screen are actually drawn, and i have a 100x100 grid you can scroll across. Each block is also a class, that draws itself. (the grid is random at the moment. also i have set it up so if the block is in the top part of the screen it doesn't draw the back etc. My Question: Is it taking a performance hit using glTranslatef rather than say, translating once and then drawing it all from there rather than the local axis of each box? btw, i put in a counter and there is about 314 blocks on screen at one time(with random generation at the beginning, stored in an array) Edited by - xgkkp on February 2, 2002 6:14:53 PM

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by Xgkkp
My Question: Is it taking a performance hit using glTranslatef rather than say, translating once and then drawing it all from there rather than the local axis of each box?

It depends on whether or not the video card the user (you in this case) has has T&L or not.

Share this post


Link to post
Share on other sites
I have a geforce2, so i am okay on that point but then what do i do for people who don''t?

Share this post


Link to post
Share on other sites
no matter what card you use, you will take a performance hit if you do more transformations then required to get the same results. but you also have to take into account easy of use. personally i think that grids in a street system are better represented as being stored in world coordinates due to the fact that is how you move through it. you will never rotate a block i am guessing? (unless you are making a city like in those tire commercials which changes to suite what the driver wants, heh). also you should only transform the blocks that can possibly be on the screen instead of the whole city (which you probablly know already, but i feel its worth mentioning for others that read this). backface culling may be faster if preformed by the transformation system (ie let gl do it), mainly because you would have to sort your polys by depth. then have to deal with rotations when trying to take them out quickly. in fact you are probally using the same algo as opengl does when it gets rid of them (ie checking the vertex normal dot product with the camerea vector).

the question that you should ask yoruself, why do i need to have the blocks in local coordinates vs world coordinates? compare the advantages and disadvantages, you may want to take teh speed hit if you get something much greater by using local coordinates.

Share this post


Link to post
Share on other sites

  • Advertisement