Hi Raphaël,

Raphaël DUCOM wrote:
> Ok.
> 
> Hello Dirk.
> 
> Since a week, I start becoming mad with strange values from the
> IntersectAction::getNormal() method...  It seem there is a bug, this
> method does'nt return the normal of the Hit triandle, but a vector
> which is the cross product of the ray direction and one once the edges
> of the triangle.

True.

> I think the return value should be  qvec instead of pvec, but I'm not
> sure.. (see the above code)

Actually it's neither. ;)

> Instead, I'm using this code wich is not optimized but wirks great, so
> there should be a problem :
> 
> TriangleIterator it(act->getHitObject());
> it.seek( act->getHitTriangle() );
> Vec3f v1 =  it.getPosition(1)-it.getPosition(0);
> Vec3f v2 =  it.getPosition(2)-it.getPosition(0);
> Vec3f norm = v1.cross(v2);
> norm.normalize();

Yup, that's the fix.

> So I think there is something.... or maybe we undersdant "Nomal" in a
> different way.

Nope, the definition is pretty clear, I don't think there is a way to 
misinterpret that.

Thanks for the hint, fixed!

        Dirk

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to