Archived

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

Polemarch

Of View Transforms and Polygon Sorting

Recommended Posts

Polemarch    122
Hi, I was wondering if someone could let me know if I am the right track with this one. I am using Alpha-Blending to simulate translucent objects so the Z Buffer must be deactivated to avoid occlusion. This leads to the need to Sort the objects into z order to ensure they are drawn in the right order (Front-to-Back). However before sorting can occur the objects must be oriented to the View Axis and there in lies the problem. It seems a bit redundant to me because DirectX then transforms the world to view co-ords after you draw the objects in order, but you already have the View Co-ordinates calculated when you sorted. So would it be more effective to set the View Matrix to the Identity Matrix and use your calculated figures OR only orient the Z-Co-ords to the View for sorting and leave the rest to Direct X View Transform. Of course I may have this all around the wrong way so any advise would be helpful. Thanks in advance!

Share this post


Link to post
Share on other sites
Sandman    2210
Why not just shoot a ray from the camera position to the object position, take the magnitude (dont bother with the square root) and sort by that? I dont see any real need for transforming every vertex on the object, it seems like a lot of extra work for nothing. Shout if ive missed something obvious...

Share this post


Link to post
Share on other sites