• Advertisement

Archived

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

Clipping with Lesson23?

This topic is 6286 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''m trying to mess with Lesson23 as I learn with it, and ive been trying to figure out a way to not print out to screen extra polygons that can not be seen at the time. Is there a quick and easy way of doing this with the framework of lesson23? Any suggestions would be *extremely* appreciated!

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
OK... Think about lines... You need to check whether or not a polygon is behind the player (if you simply check within the players view, you may miss some).
Lets take a view from above (literally!!).
A line uses the form y = m * x + b
Sound familiar?
So convert the player angle to a gradient ("m"), I''ve forgotten the math for this, sorry. But anyways... after doing that, position the line so that it passes through the player (using "b"). Now you can check each point of a polygon and if all points are behind the player, don''t draw it. You check by changing the "=" to a "<" or ">".
I haven''t really thought to much about what I''m writing, just trying to remember cos I''m in a hurry, sorry.

Share this post


Link to post
Share on other sites
hi,
i was too wondering the same. too bad haven''t have a clue. drawing all the polygons make it slow. Please if anyone has the compiled code for this, post it here.

Compliments,
The Demolition Squad

Share this post


Link to post
Share on other sites
actually, removing backface culling is just the START of culling. you too can add frustum culling. if you have the opengl superbible, they talk a little about this. but i''d also like to figure out how to do this. i think if you really wanna get fancy, (and fast) you have to look into BSP trees to organize all objects that can/can''t be rendered to the viewable region.

a2k

Share this post


Link to post
Share on other sites
where do you call this function?

actually, where do you enable it, and where do you call the function?


Edited by - NPComplete on November 3, 2000 2:05:31 PM

Share this post


Link to post
Share on other sites

  • Advertisement