need help~~~~~~~~
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?
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.
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.
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?
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).
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).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement