Author Topic: creating a box  (Read 702 times)

Offline leorus

  • byte
  • *
  • Posts: 3
    • View Profile
creating a box
« on: August 29, 2013, 01:49:16 pm »
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

Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
Re: creating a box
« Reply #1 on: September 01, 2013, 08:22:44 am »
 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 .
« Last Edit: September 01, 2013, 04:47:19 pm by Wolf17 »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: creating a box
« Reply #2 on: September 01, 2013, 09:32:42 pm »
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.