Thanks Brad,
By the time I received this email, I just finished
doing what you said here. I created a IndexedTriangleStripArray
from a 2d grid of coordinates. It worked well.
Thank you for the help.
By the way, is it possible to extend the Java3d by creating
new Geometry classes? For example, it might be a good idea
to implement Indexed2DGrid.
Mingtian
On Mon, 21 Oct 2002, Brad Christiansen wrote:
> Hi,
>
> Just a quick point.
>
> >The TriangleStripArray essentially supports only two rows of points.
>
> This isn't the case. Each strip consists of two 'rows' of points, but you can have
>multiple strips. I have used this to
> represent a 2D grid of coordinates. No idea if this is what you where thinking but
>the following code generates a
> TriangleStripArray from a grid of Point3fs (represented as a 2D array).
>
> Cheers,
>
> Brad
>
>
> public TriangleStripArray createGeometry(Point3d[][] coords) throws Exception {
>
> int numRows = coords.length;
> int numCols = coords[0].length;
>
> System.out.println("NumRows=" + numRows + " NumCols=" + numCols);
>
> int[] stripCounts = new int[numRows - 1];
> for(int i=0; i < stripCounts.length; i++) {
> stripCounts[i] = numCols*2;
> }
>
>
> TriangleStripArray ta = new TriangleStripArray( (numRows - 1) * (numCols * 2),
>TriangleStripArray.COORDINATES, stripCounts);
>
> int coordCount = 0;
> //for each strip
> for(int i=0; i < stripCounts.length; i++) {
> //for each col
> for(int j=0; j < numCols; j++) {
> ta.setCoordinate(coordCount, coords[i][j]);
> coordCount++;
>
> ta.setCoordinate(coordCount, coords[i+1][j]);
> coordCount++;
> }
> }
>
> return ta;
> }
>
>
>
>
> Mingtian Ni wrote:
> >
> > Hi all,
> > I am new with Java3D. I am sorry if this question was raised
> > to this group before. I am developing an application which is
> > supposed to display discrete samples defined on a 2D grid as a 3d surface.
> > I am planning to do it by triangulation which simply connects neighboring
> > points to form triangles. My questions are
> > 1. Does java3d directly support data sets defined on 2d grid? The
> > TriangleStripArray essentially supports only two rows of points.
> > 2. Can java3d generate vertex normals automatically?
> >
> > Thanks in advance!
> >
> > Mingtian Ni
> >
> > ===========================================================================
> > 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".
>
>
> ----------------------------------------------------------------------------
> This Email may contain confidential and/or privileged information and is
> intended solely for the addressee(s) named. If you have received this
> information in error, or are advised that you have been posted this Email by
> accident, please notify the sender by return Email, do not redistribute it,
> delete the Email and keep no copies.
> ----------------------------------------------------------------------------
>
> ===========================================================================
> 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".