Jump to content
  • Advertisement

Archived

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

north_wolf

need help~~~~~~~~

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

how to render transparency polygons with solid leaf tree? i think it should be rendered at a back to front order,but how can i sort them in a solid leaf tree?

Share this post


Link to post
Share on other sites
Advertisement
Because your data is in a structure doesn''t mean you are bound to it.

A possibility :

- Create an appropriately sized array (malloc/new...), once should be enough.
- fill it with pointers to your polys.
- sort the pointer array according to the Z of the pointees.

Share this post


Link to post
Share on other sites
thank u. but it is hard to sort polygons by its Z value without using a BSP tree, i think. can you explain to me in a detail please?

Share this post


Link to post
Share on other sites
With a vector : brute force N^2.

You have a BSP tree ?

- determine which side of the partition is in the back (dot product the view vector with the normal of the partition plane).
- render the back side (recursively)
- render the front side (recursively)

You don''t have a BSP tree ? Build one (with pointers to the actual data).

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!