Archived

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

north_wolf

need help~~~~~~~~

Recommended Posts

north_wolf    122
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
Fruny    1658
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
Fruny    1658
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