<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div id="yiv720750952"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; -x-system-font: none;" valign="top">Hello<br><br>I would like to implement ComputeSphereVisibility. The sting game is completely black because of this stubbed function. Here is my idea to implement it. Am I in the good way, or it is completely a bad idea?<br><br>With GetViewport, I retrieve the viewport matrix V, and with GetTransform, I retrieve projection P and world W matrices ofn the device.<br><br>I multiply the three matrices in a matrice M: M=VPW<br><br>If M is singular, function
returns with a failing message<br>Otherwise, with the matrix M I retrieve the planes of the frustum view (that's a little bit of math, but quite easy)<br><br>Then for each sphere,<br><br> Let Visibility=0<br> for each plane of the frustum view<br> Let I be the intersection of the orthogonal projection of the center sphere on the plane. <br> If I is in the frustum view,
then I have the visibility.So <br> Visibility=Visibility|(flag for the visibility of the chosen plane)<br><br>Once I did it for the 6 plane, I have the visibility of the sphere.<br><br>Is it a good point of start?<br><br>David <br><br></td></tr></tbody></table><br>
</div></blockquote></td></tr></table><br>