Merging Primitive planes

Started by jpro, December 01, 2010, 08:37:25 PM

Previous topic - Next topic

jpro

Is there any reason I shouldn't do:


Object3D plane1 = Primitives.getPlane(1, 10f);
Object3D plane2 = Primitives.getPlane(1, 10f);
plane2.rotateX((float) Math.toRadians(90));

Object3D merged = Object3D.mergeObjects(plane1, plane2);
world.addObject(merged);
world.buildAllObjects();


When I do so only one plane is visible.

Nick

Hey jpro,

Maybe the camera is set up so you're looking to a plane from behind or from the side. You must mention that when creating planes you can only display one side. I think this is the reason for your problem, so you could just try to rotate the other plane or the camera. Maybe that helps?

jpro

A decent guess, but it's not visible from any angle. Camera is in fly mode and I have checked it from below, above, left, right, etc.

EgonOlsen

You are rotating via matrix transform only this way. Add a


plane2.rotateMesh();
plane2.clearRotation();


after the rotateX to make it permanent and see if that helps.

jpro


EgonOlsen

If you are doing this only to work around backface culling, then Object3D.setCulling(false); does the same thing without duplicating the geometry. If lighting is an issue, it might be useful to double the plane as you do though.