creating a box

Started by leorus, August 29, 2013, 01:49:16 PM

Previous topic - Next topic

leorus

I have just started using jpct-ae with eclipse.
I do not know how to create a 3d box with required width, height and width. I tried using object=Primitives.getBox(float scale, float scale height). But I am not able to get the required box( length-10, height-2 and depth-50) . can any none please guide me how to do this.

leo

Wolf17

#1
 Hi leo!

  What  exactly you are getting ?Are the box with wrong dimensions or they are not appearing  on the screen at all? Did you build and add your object3d primitive. Example-
cube = Primitives.getCube(10);
cube.build();
world.addObject(cube);

Also check your camera so that it sees the box in case if it is not visible.
cam.lookAt(cube.getTransformedCenter());
Also check that your camera is far enough .....
i.e it should be not inside the box .

EgonOlsen

The wiki has example code to create a cube. It shouldn't be too hard to modify it in a way that it creates arbitrary boxes.