Example usage for javax.media.j3d TriangleStripArray setCoordinates

List of usage examples for javax.media.j3d TriangleStripArray setCoordinates

Introduction

In this page you can find the example usage for javax.media.j3d TriangleStripArray setCoordinates.

Prototype

public void setCoordinates(int index, float coordinates[]) 

Source Link

Document

Sets the coordinates associated with the vertices starting at the specified index for this object.

Usage

From source file:AppearanceExplorer.java

Shape3D createTriangleStripArray() {

    int[] stripLengths = new int[1];
    stripLengths[0] = 5;//w w w .ja v a  2 s.c  o m
    Point3f pnt[] = new Point3f[5];
    pnt[0] = new Point3f(-1.0f, -1.0f, 0.0f);
    pnt[1] = new Point3f(1.0f, -1.0f, 0.0f);
    pnt[2] = new Point3f(-1.0f, 0.0f, 0.0f);
    pnt[3] = new Point3f(1.0f, 0.0f, 0.0f);
    pnt[4] = new Point3f(1.0f, 1.0f, 0.0f);

    TriangleStripArray tsa = new TriangleStripArray(5, GeometryArray.COORDINATES, stripLengths);
    tsa.setCoordinates(0, pnt);

    return new Shape3D(tsa, appearance);
}