Hi,
here is a patch for a first try to implement ComputeSphereVisibility. Any feedback is welcome.
David
On 14.11.2008 20:27, paulo lesgaz wrote:
Hi,
here is a patch for a first try to implement ComputeSphereVisibility. Any feedback is welcome.
I think you can simplify the sphere-plane intersection. Just compute the signed distance D of the sphere center from the plane. If D > r, the sphere is visible. If -r <= D <= r, the sphere is partially visible. if D < -r, it's invisible.
Also, wine people like tests. You should probably add some.
-f.r.
Hello,
can anyone test the the following tests in a windows box, please? The option to be given at the executable is d3d.
Thanks in advance
David
--- En date de : Sam 15.11.08, Frank Richter frank.richter@gmail.com a écrit : De: Frank Richter frank.richter@gmail.com Objet: Re: ComputeSphereVisibility: a patch À: "paulo lesgaz" jeremielapuree@yahoo.fr Cc: wine-devel@winehq.org Date: Samedi 15 Novembre 2008, 19h14
On 14.11.2008 20:27, paulo lesgaz wrote:
Hi,
here is a patch for a first try to implement ComputeSphereVisibility. Any feedback is welcome.
I think you can simplify the sphere-plane intersection. Just compute the signed distance D of the sphere center from the plane. If D > r, the sphere is visible. If -r <= D <= r, the sphere is partially visible. if D < -r, it's invisible.
Also, wine people like tests. You should probably add some.
-f.r.
2008/11/15 Frank Richter frank.richter@gmail.com:
On 14.11.2008 20:27, paulo lesgaz wrote:
Hi,
here is a patch for a first try to implement ComputeSphereVisibility. Any feedback is welcome.
I think you can simplify the sphere-plane intersection. Just compute the signed distance D of the sphere center from the plane. If D > r, the sphere is visible. If -r <= D <= r, the sphere is partially visible. if D < -r, it's invisible.
Yeah, that's basically what I described in my earlier mail.
Hi,
here is a new patch for ComputeSphereVisibility implementing Henri and Franck's idea.
The problem is that the test takes the value 0x3f once (if the test is correct), and that my function can not never obtain such a value.
Any idea to fix this problem. Here is the only one link talking about ComputeSphereVisibility
http://209.85.135.104/search?q=cache:ZkQTOaa7h7UJ:salaam.cs.buap.mx/EBOOKS/I...
Thanks for the help.
David --- En date de : Lun 17.11.08, Henri Verbeet hverbeet@gmail.com a écrit : De: Henri Verbeet hverbeet@gmail.com Objet: Re: ComputeSphereVisibility: a patch À: "Frank Richter" frank.richter@gmail.com Cc: "paulo lesgaz" jeremielapuree@yahoo.fr, wine-devel@winehq.org Date: Lundi 17 Novembre 2008, 0h21
2008/11/15 Frank Richter frank.richter@gmail.com:
On 14.11.2008 20:27, paulo lesgaz wrote:
Hi,
here is a patch for a first try to implement ComputeSphereVisibility. Any feedback is welcome.
I think you can simplify the sphere-plane intersection. Just compute the signed distance D of the sphere center from the plane. If D > r, the sphere is visible. If -r <= D <= r, the sphere is partially visible.
if
D < -r, it's invisible.
Yeah, that's basically what I described in my earlier mail.
2008/11/17 paulo lesgaz jeremielapuree@yahoo.fr:
The problem is that the test takes the value 0x3f once (if the test is correct), and that my function can not never obtain such a value.
Looks like you need to set one of the D3DVIS_INSIDE_FRUSTUM/D3DVIS_INTERSECT_FRUSTUM/D3DVIS_OUTSIDE_FRUSTUM flags, depending on which applies. The values of the flags also suggest INSIDE/OUTSIDE applies to the sphere centers rather than the sphere as a whole. Ie, you can have both D3DVIS_INSIDE_LEFT and D3DVIS_INTERSECT_LEFT set. You would need to write tests for this, of course.
vec.u1.x = m._14 + m._11;
vec.u2.y = m._24 + m._21;
vec.u3.z = m._34 + m._31;
origin_plane = m._44 + m._41;
Note that the planes you get from this aren't necessarily normalized.