I am wanting to change the color of an object at runtime. Now, I have placed an AppearanceNode with the object as well. I have tried to do the following.
 
The object is made up of just 2 Geomentry nodes, the first a QuadArray and the second a TriangleFanArray. I try to set the colors, and the colors (when printed) have the correct value, but the
objects color goes away.
 
Can anyone help.
 
Thank you for your time
 
Zak
 
 
 
 
 
public void repaint(){
 


TriangleFanArray tArray = (TriangleFanArray)WireFrameSensor.getGeometry(1);

Color3f[] wireColors  = new Color3f[tArray.getVertexCount()];
for(int y = 0; y < wireColors.length;y++){
wireColors[y] = new Color3f(GlobeDefaults.RED);
 
}
 

fanArray.setColors(0,wireColors);
for(int i =0; i < fanArray.getVertexCount(); i++){
 Color3f c  = new Color3f();
 fanArray.getColor(i,c);
 System.out.println("color:" + c);
}
 
}
}

Reply via email to