I use picking for my collision detection and I'm trying to get the normal of
the wall I'm stopping at.

Here's the code I use:
------------------------------------------------------------------------------------
Node pickNode = picked.getObject();
Geometry curGeom = ((Shape3D)pickNode).getGeometry();
GeometryArray curGeomArray = (GeometryArray) curGeom;

Vector3f normalVec = new Vector3f();
curGeomArray.getNormal(0, normalVec);

System.out.print(picked);
------------------------------------------------------------------------------------
So, when I stop at a wall, I get an error message which tells me the
geometry doesn't have a normal...what could be the problem? I use QuadArray
for the walls, and I tried setting the flag QuadArray.GENERATE_NORMALS, and
QuadArray.NORMALS, then using setNormal(int, Vector3f) to set the normal for
each vertex..but I still get the same error...

Thank you for your help

Flavius

_________________________________________________________________
Hitta rätt på nätet med MSN Sök http://search.msn.se/

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to