|
-
Sep 16th, 2002, 01:49 PM
#1
Thread Starter
Lively Member
DX8 - Culling
Hi
I am currently implementing culling that uses D3DXVec3Project to determine wether or not a polygon is on screen based on the 2D screen coords returned. This method requires many calculations to determine wether to draw a polygon or not and thus the speed advanatage is lost to some degree. Does any1 know of any articles that implement culling using VB (Not just theory but code as well) that are better?
I think this a long shot but hey its worth a try
Cheers
Dan
PS I have read up on Quadtrees etc. but without VB code I have no idea how to implement them.
-
Sep 16th, 2002, 03:02 PM
#2
Thread Starter
Lively Member
Im having a brainwave here but still need help. I was thinking that using the function mentioned in the last post I would have to check every single vertex (a lot of processing). However, now Im realising I could check areas rather than every single vertex. The thing is I am also realsiing that u could further reduce the amount of goeometry drawn by not drawing things behind other things. Does any1 know functions for this purpose?
Imagine a big rectangular world. If a player were in the bottom left corner of the world and looked at the top right corner, virtually all vertices would be drawn unless u didnt draw things behind other things thus improving efficiency greatly.
Can any1 help me further on these thoughts.
Cheers
Dan
-
Sep 16th, 2002, 03:09 PM
#3
Good Ol' Platypus
Look into quadtrees or octrees (each has its own use; eg. for inside and other other for outside).
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Sep 16th, 2002, 03:09 PM
#4
Frenzied Member
Heh, if you check visibility by transforming a vertex, you lose any spped gain you would get from saving vertex transformations (since you have to transform EVERY vertex at least once), and D3DXVec3Project() will do EVERYTHING in software, losing still more time.
At the moment, I am projecting the screen corners into world space, and intersecting those rays with a ground plane (plane, a0, b1, c0, d0). From the intersection values, I can find a bounding rectangle, and check to see if a point is within that rectangle. This is a very application specific test, though. Most people looking for a simple test use Frustum culling. The view volume is enclosed in 6 planes, which you can use to test visibility. If you enclose your objects in spheres, you can take the distance from the center of each sphere to each plane. If any of the distances is less then (-spRadius), then the sphere is completely outside of the view volume, and can be discarded.
Google it =).
Z.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|