Translating viewplatform causes trouble
My scene is setup like this:
* I have a 2D textured plane on z=0 from x,y=1,1 to x,y=-1,-1
* There are a couple of objects located on the plane, basically pyramids, pointing upwards (to z+), but their base is at z=0, on the plane, during the course of the application they are moving across the plane, being translated along the x/y axis, they are scaled down when the scene is setup
After that is setup, I add some behaviors to the viewplatform transform (universe.getViewingPlatform().getViewPlatformTransform()), behaviors like MouseTranslate.
When I use the behaviors to move the eye position, the 2D plane seems to turn and the pyramids sink through the surface or (when on the other side) rise above the surface. So, instead of just the camera moving (which is what I want), the different objects move through eachother while the camera is moving.
The same thing happens when I attach the behaviors to the rootTransform object.
Can anybody tell me how to shut this behavior off, as in, move the camera without changing the rest of the scene. Thnx.
The pyramid geometry:
Geometry createGeometry(int face, Color3f color, Color3f topColor){
TriangleArray geomList =new TriangleArray(3, TriangleArray.COORDINATES | TriangleArray.COLOR_3);
Point3f point =new Point3f();
switch (face){
case 0:
point.set(-1.0f, 1.0f, 0.0f);
geomList.setCoordinate(0, point);
geomList.setColor(0, color);
point.set(-1.0f, -1.0f, 0.0f);
geomList.setCoordinate(1, point);
geomList.setColor(1, color);
point.set(0.0f, 0.0f, 2.0f);
geomList.setCoordinate(2, point);
geomList.setColor(2, topColor);
break;
case 1:
point.set(1.0f, -1.0f, 0.0f);
geomList.setCoordinate(0, point);
geomList.setColor(0, color);
point.set(1.0f, 1.0f, 0.0f);
geomList.setCoordinate(1, point);
geomList.setColor(1, color);
point.set(0.0f, 0.0f, 2.0f);
geomList.setCoordinate(2, point);
geomList.setColor(2, topColor);
break;
case 2:
point.set(-1.0f, -1.0f, 0.0f);
geomList.setCoordinate(0, point);
geomList.setColor(0, color);
point.set(1.0f, -1.0f, 0.0f);
geomList.setCoordinate(1, point);
geomList.setColor(1, color);
point.set(0.0f, 0.0f, 2.0f);
geomList.setCoordinate(2, point);
geomList.setColor(2, topColor);
break;
case 3:
point.set(1.0f, 1.0f, 0.0f);
geomList.setCoordinate(0, point);
geomList.setColor(0, color);
point.set(-1.0f, 1.0f, 0.0f);
geomList.setCoordinate(1, point);
geomList.setColor(1, color);
point.set(0.0f, 0.0f, 2.0f);
geomList.setCoordinate(2, point);
geomList.setColor(2, topColor);
break;
}
return geomList;
}
//called like this
removeGeometry(0);
addGeometry(createGeometry(0, glColor, glTopColor));
addGeometry(createGeometry(1, glColor, glTopColor));
addGeometry(createGeometry(2, glColor, glTopColor));
addGeometry(createGeometry(3, glColor, glTopColor));
The 2D plane geometry:
QuadArray plane =new QuadArray(4, GeometryArray.COORDINATES
| GeometryArray.TEXTURE_COORDINATE_2 );
Point3f p =new Point3f(-1.0f, 1.0f, 0.0f);
plane.setCoordinate( 0, p);
p.set(-1.0f, -1.0f, 0.0f);
plane.setCoordinate( 1, p);
p.set(1.0f, -1.0f, 0.0f);
plane.setCoordinate( 2, p);
p.set(1.0f, 1.0f, 0.0f);
plane.setCoordinate( 3, p);
TexCoord2f q =new TexCoord2f( 0.0f, 1.0f);
plane.setTextureCoordinate(0, 0, q);
q.set(0.0f, 0.0f);
plane.setTextureCoordinate(0, 1, q);
q.set(1.0f, 0.0f);
plane.setTextureCoordinate(0, 2, q);
q.set(1.0f, 1.0f);
plane.setTextureCoordinate(0, 3, q);

