Archived

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

Very Simple clipping question.....

This topic is 5683 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 was going to implement a clipping algo into my engine in progress, but I am a little confused.... here are my basic questions: clipping is just "cutting" the verticies so that they do not excede the bounds of the screen or other in game object that blocks the object partially from the camera? am i right? if so... how do you implement such thing? im using DX 8.0 and was wondering... do you just change the verticies for every tri that is cut by the screen? im just really confused and wuld love the help of all you intelligent ppl otu there dwiel ~ tazzel3d

Share this post


Link to post
Share on other sites
You only need to worry with clipping polys yourself if you are writing a software 3D engine. With hardware accelrated APIs, (ie DX8 and OpenGL) the driver handles it for you.

What you should be interested in, rather than clipping vertices, is culling objects. This means determining if an object is visible in the camera view or not. If it is, you send the whole object to the renderer, and if not, you just ignore it. There are several ways of going about this, and it all depends on the type of engine you are writing. BSP trees and Octrees are well-suited for specific cases (as examples: BSP for nearly everything in a FPS, octrees for terrain). A more general solution is to test an object against the view frustum. This is known as frustum culling. Google should turn up lots of hits. There's a really good article out there I read before (which I can't find in my favorites folder at the moment) but I believe it's linked from either here or flipcode.



[edited by - Aldacron on June 26, 2002 9:58:03 PM]

Share this post


Link to post
Share on other sites