Archived

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

Simple Visibility Ordering Question

This topic is 5346 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I have a ROAM implementation. I want to implement a correct far to near visibility ordering. Here is how I am currently doing it: I start with the root nodes, I simply determine which node I am in. I render the other one first. As I traverse the tree I: 1. Take the current isoscelese right triangle. I treat the imaginary line which runs down the triangle from the apex to the midpoint of left/right vertices as a plane of 2 dimensions. I am assuming Y values should not matter. 2. Now I simply take the imaginary line and determine which side I lie on. If I lie on the side representing the left child of the original triangle, then I render the right child first, otherwise I render the left first. This is not working. What's the typical method for visibility ordering in ROAM type datastructures? [edited by - haro on March 29, 2004 4:13:06 AM]

Share on other sites
I just developed another method. I take each triangle I am rendering. I then take the relative distance ( ie- no sqrt ) from the player position to the centroid that would be created from each triangle's children. I then return the difference of distance1-distance2. This determines if the player is closer to d1 or d2 depending on the sign. I use this to create a visibility ordering.

EDIT: This creates a near perfect visibility ordering, but its still wrong.

[edited by - haro on March 29, 2004 4:36:39 AM]

Share on other sites
UPDATE: The centroid method works perfectly fine for ordering calculations. I made a few silly mistakes when I coded the algorithm at 4am.

[edited by - haro on March 29, 2004 8:38:28 PM]

Share on other sites
If you are using ROAM, then you have a binary triangle tree, which is a BSP tree. There is no need to compare distances.

Share on other sites
quote:
Original post by JohnBolton
If you are using ROAM, then you have a binary triangle tree, which is a BSP tree. There is no need to compare distances.

I tried using the base plane as the partitioning plane, I also tried using the line which will split each node as the partitioning plane. Neither of these methods worked flawlessly which was my original question. Nobody mentioned the general method which was why I switched to the centroid method.

The centroid method also only requires a total of 8 subtractions and 4 multiplications.

Share on other sites
As a general rule, I find that you will have more correct results with visibility ordering if you do it with only the pseudodepth (z-value of a projected vertex). After all, this is the only depth that the z-buffer cares about.

1. 1
Rutin
42
2. 2
3. 3
4. 4
5. 5

• 18
• 20
• 14
• 14
• 9
• Forum Statistics

• Total Topics
633375
• Total Posts
3011554
• Who's Online (See full list)

There are no registered users currently online

×