next up previous contents
Next: Visibility of a Cylinder Up: Computing Visibility Previous: Occlusion Test

Visibility of Another Fish

 

To determine the visibility of another fish, we take advantage of the mass-spring-damper structure of the fish model. To first determine if fish j is within fish i's view volume, we simply test if the center of j's body tex2html_wrap_inline3220 (we use the origin of the fish local coordinate system tex2html_wrap_inline3106 as the center point) falls within the view volume of i (Note that, the view volume of fish i is tex2html_wrap_inline3228 instead of tex2html_wrap_inline3068 ). If it is, we proceed as follows: Fish j is visible to fish i if and only if any one of the mass points of j is visible to i (i.e. not occluded by any other objects). In Fig. gif, the fish represented by the mass-spring-damper model is visible. It should be pointed out that, although in the worst case this visibility check can be expensive (each fish has 23 nodes), on average it is much better since the algorithm will reach a conclusion as soon as it finds a single visible node. In the case of a more complicated virtual environment, we can use bounding box techniques to speed up the occlusion test.


next up previous contents
Next: Visibility of a Cylinder Up: Computing Visibility Previous: Occlusion Test
Xiaoyuan TuJanuary 1996