<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="yiv755683805"><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">I need to use some functions implemented in d3dx8 to do the job.<br><br>Can I link this dll to ddraw (even if it is not logical in a Windows point of view) or I need to reimplement all the needed math functions in wined3d?<br><br>David <br>--- En date de : <b>Jeu 13.11.08, Henri Verbeet <i><hverbeet@gmail.com></i></b> a écrit :<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">De: Henri
Verbeet <hverbeet@gmail.com><br>Objet: Re: DDRAW: ComputeSphereVisibility: Am I in the good way?<br>À: jeremielapuree@yahoo.fr<br>Cc: wine-devel@winehq.org<br>Date: Jeudi 13 Novembre 2008, 16h13<br><br><pre>2008/11/13 paulo lesgaz <jeremielapuree@yahoo.fr>:<br>> Hello<br>><br>> I would like to implement ComputeSphereVisibility. The sting game is<br>> completely black because of this<br> stubbed function. Here is my idea to<br>> 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 <br>GetTransform,<br>> 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<br>> (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<br>> 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<br> the 6 plane, I have the visibility of the sphere.<br>><br>> Is it a good point of start?<br>><br>> David<br>><br>The basic idea sounds about right. I don't think you need to project<br>the sphere onto the frustum planes, just using the plane normal to<br>calculate the distance to the sphere center should do.<br></pre></blockquote></td></tr></tbody></table><br>
</div></blockquote></td></tr></table><br>