<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&nbsp;: <b>Jeu 13.11.08, Henri Verbeet <i>&lt;hverbeet@gmail.com&gt;</i></b> a écrit&nbsp;:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">De: Henri
 Verbeet &lt;hverbeet@gmail.com&gt;<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 &lt;jeremielapuree@yahoo.fr&gt;:<br>&gt; Hello<br>&gt;<br>&gt; I would like to implement ComputeSphereVisibility. The sting game is<br>&gt; completely black because of this<br> stubbed function. Here is my idea to<br>&gt; implement it. Am I in the good way, or it is completely a bad idea?<br>&gt;<br>&gt; With GetViewport, I retrieve the viewport matrix V, and with <br>GetTransform,<br>&gt; I retrieve projection P and world W matrices ofn the device.<br>&gt;<br>&gt; I multiply the three matrices in a matrice M: M=VPW<br>&gt;<br>&gt; If M is singular, function returns with a failing message<br>&gt; Otherwise, with the matrix M I retrieve the  planes of the frustum view<br>&gt; (that's a little bit of math, but quite
 easy)<br>&gt;<br>&gt; Then for each sphere,<br>&gt;<br>&gt;   Let Visibility=0<br>&gt;     for each plane of the frustum view<br>&gt;    Let I be the intersection of the orthogonal projection of the center<br>&gt; sphere on the plane.<br>&gt;    If I is in the frustum view, then I have the visibility.So<br>&gt;     Visibility=Visibility|(flag for the visibility of the chosen plane)<br>&gt;<br>&gt; Once I did it for<br> the 6 plane, I have the visibility of the sphere.<br>&gt;<br>&gt; Is it a good point of start?<br>&gt;<br>&gt; David<br>&gt;<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>