Apply a Texture on a shape?

Hi!

I use VisAD to display some orbit stuff. I display planets with sphere
shapes using:

       VisADTriangleStripArray vitsa = new VisADTriangleStripArray();

        Sphere sphere = new Sphere(1.0f,Sphere.GENERATE_NORMALS,30);
        GeometryArray ga = (GeometryArray)sphere.getShape().getGeometry();

        GeometryInfo gInf = new GeometryInfo(ga);

        float[] fcoords = new float[gInf.getCoordinates().length*3];
        for(int i=0;i<gInf.getCoordinates().length;i++){
            fcoords[3*i] = gInf.getCoordinates()[i].x;
            fcoords[3*i+1] = gInf.getCoordinates()[i].y;
            fcoords[3*i+2] = gInf.getCoordinates()[i].z;
        }
        vitsa.coordinates=fcoords;

        float[] fnormals = new float[gInf.getNormals().length*3];
        for(int i=0;i<gInf.getNormals().length;i++){
            fnormals[3*i] = gInf.getNormals()[i].x;
            fnormals[3*i+1] = gInf.getNormals()[i].y;
            fnormals[3*i+2] = gInf.getNormals()[i].z;
        }

        vitsa.vertexFormat=ga.getVertexFormat();
        vitsa.normals=fnormals;
        vitsa.stripVertexCounts=gInf.getStripCounts();
        vitsa.vertexCount = vitsa.coordinates.length / 3;


I would like to add texture to shapes but I can't find what renderer or
shadow type I have to modify.

Has somebody allready done that or know how to do it?


I'm wondering also if there's a better way to set a shape rotating during
animation.
Currently, I use something like tupleType (x,y,z,color,shape) with shapes
number = values number.

A preview of actual rendering:(See attached file: rosetta_now.png)

Thanks!

Laurent BEIGBEDER
GFI Informatique
Toulouse - FRANCE

Attachment: rosetta_now.png
Description: Binary data

  • 2005 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: