www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: hisong on February 20, 2012, 07:19:22 am

Title: How to Draw a circle?
Post by: hisong 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?
Title: Re: How to Draw a circle?
Post by: EgonOlsen 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.
Title: Re: How to Draw a circle?
Post by: hisong on February 20, 2012, 03:49:06 pm
Thanks a lot. I will try it.