Hello,
Here's an idea. I once had to "fill" a geometry (which was half a ship) by
inverting the y values. For triangles, you will have to switch two of the
coordinates (I'd suggest the second and third points of every triangle).
Then the easiest thing to do is to use the normal generator. This will help
you avoid the misery of having to calculate them from the originals.
Example, for points in geometry array as [a,b,c,d,e,f], you would switch to
[a,c,b,d,f,e] and then run the normal generator. This worked swimmingly for
me.
Cheers,
B.
-------------------------
Oceanic Consulting Corporation
P.O. Box 28009
St. John's, NF, Canada
A1B 4J8
(709) 722-9060 ext 25
(709) 722-9064(fax) http://www.oceaniccorp.com
-------------------------
-----Original Message-----
From: Zeldin, Boris [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 18, 2000 5:57 PM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] flipping geometry
Something is wrong here. If in you mesh you substitute a point (x,y,z) with
a point (-x,y,z) then all your triangles will hvae vertices in a wrong
order. Just normals will not work to fix this problem.
Boris
> ----------
> From: Yan Laporte[SMTP:[EMAIL PROTECTED]]
> Reply To: Discussion list for Java 3D API
> Sent: Tuesday, August 15, 2000 1:37 PM
> To: [EMAIL PROTECTED]
> Subject: [JAVA3D] flipping geometry
>
> Hello everyone...
>
> I was wondering if anyone has found a way to flip an object using J3D...
>
> The geometry is just a triangle array that I create from a indexed
> trinagle
> set from a VRML file (home made loader), I read the normals from ths file
> as
> well... I would like to just flip that object over the x coordinate. As
> far as flipping the geometry it seems to work fine by the just switching
> the
> sign on th ex coordinate of each points... However there is a problem
> with
> the normals... I can't figure out how to have the normals follow. If
> leave
> them as is of course it is a problem because they are facing the wrong
> way... I try to change the sign of the x coordinates on the normal vector
> as well (something that made sense to me) and it seems to be working only
> partialy. Using negative scaling factors doesn't seem to do the trick
> either.
>
> Does anyone has ever flipped an object in J3D or found a way ti achieve
> similar results. Maybe I am just poor at linear algebra.
>
> Could that be a new transform made available in the next verosin of J3D as
> well?
>
> Yan Laporte
> DMI
> Universit� de Sherbrooke
> [EMAIL PROTECTED]
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
> ==========================================================================
> =
> 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".
>
===========================================================================
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".
===========================================================================
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".
===========================================================================
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".