Jump to content
  • Advertisement

Archived

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

Polemarch

Of View Transforms and Polygon Sorting

This topic is 6198 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

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!