Hello,

I'm playing around with Extrusion and I think there is an error in file
com.sun.j3d.loaders.vrml97.impl.Extrusion,
version @(#)Extrusion.java 1.23 99/03/24 15:56:40

on line 231 there is:
     crossSectionPts[i] = new Point3f(a2[0],0.0f,a2[1]);

shouldn't there be:
     crossSectionPts[i] = new Point3f(a2[0],a2[1],0.0f);

That is, instead of setting the x and z coordinates of crossSectionPts[i],
the x and y coordinates should be set.

The problem occurs with the simlest extrusion, where

    crossSection  is   [ 1 1, 1 -1, -1 -1,  -1 1, 1  1 ]

and

    spine  is [ 0 0 0, 0 0 1 ]

With the original version I get the following coordinates:
    coords
    (1.0, 0.0, 1.0)
    (1.0, 0.0, -1.0)
    (-1.0, 0.0, -1.0)
    (-1.0, 0.0, 1.0)
    (1.0, 0.0, 1.0)
    (1.0, 0.0, 2.0)
    (1.0, 0.0, 0.0)
    (-1.0, 0.0, 0.0)
    (-1.0, 0.0, 2.0)
    (1.0, 0.0, 2.0)

--> Values on y axis are all zero -> result is flat.

With the corrected version I get
    coords
    (1.0, 1.0, 0.0)
    (1.0, -1.0, 0.0)
    (-1.0, -1.0, 0.0)
    (-1.0, 1.0, 0.0)
    (1.0, 1.0, 0.0)
    (1.0, 1.0, 1.0)
    (1.0, -1.0, 1.0)
    (-1.0, -1.0, 1.0)
    (-1.0, 1.0, 1.0)
    (1.0, 1.0, 1.0)

--> Result is a cube as it should be!

Pasi

===========================================================================
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