Author Topic: How to Draw a circle?  (Read 1078 times)

Offline hisong

  • byte
  • *
  • Posts: 16
    • View Profile
How to Draw a circle?
« on: February 20, 2012, 07:19:22 am »
Hi,guys.

I want to draw a circle but it seems that none of funtions of Class Primitives supports to make one.

How can I do?   Or can I only make one from a 3DS or a OBJ file?

and another question:  Since I create a Skybox and add texture on it, the skybox work well.but then I want to add a object of Object3D in the Skybox, the object was invisible.


Code: [Select]
                        skyBox = new SkyBox(10);

world = skyBox.getWorld();
world.setAmbientLight(255, 255, 255);

plane = Primitives.getPlane(10, 2);
plane.strip();
plane.build();
world.addObject(plane );

// 获得相机
cam = world.getCamera();
// 设置相机的位置,在中心的位置
cam.setPosition(plane.getTransformedCenter());

cam.lookAt(new SimpleVector(0, 0, -1));

anyone help me?
« Last Edit: February 20, 2012, 08:39:36 am by hisong »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: How to Draw a circle?
« Reply #1 on: February 20, 2012, 03:19:50 pm »
There's no circle in the Primitives class. Either import one from a 3ds or obj file or, depending on your needs, simply use a plane, texture it with a circle and enable transparency with a high value.

Offline hisong

  • byte
  • *
  • Posts: 16
    • View Profile
Re: How to Draw a circle?
« Reply #2 on: February 20, 2012, 03:49:06 pm »
Thanks a lot. I will try it.