Drawing a cyliner

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Caspian
Posts: 15
Joined: Sun Mar 18, 2007 2:38 am

Drawing a cyliner

Post by Caspian »

I'm trying to create a cylinder scene node... but I don't see any sort of "addCylinderSceneNode" method -- is there any way to add a cylinder without having to create my own custom scene node?

I looked into custom scene nodes, and I really don't want to dive into specifying all the triangles myself (especially since my cylinder will be stretching and rotating). If there's an easier way, I'd be very happy :).

Thanks!
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Re: Drawing a cyliner

Post by vitek »

Caspian wrote:I'm trying to create a cylinder scene node... but I don't see any sort of "addCylinderSceneNode" method
Nope there isn't one. I'm glad to hear that you looked before posting. :)
Caspian wrote:is there any way to add a cylinder without having to create my own custom scene node?
Yes. You can use an IMeshSceneNode. You can either make the cylinder in a modelling program and then load the mesh like the example programs do for more complicated meshes, or you can create your own mesh buffer, stuff that into a mesh and set the mesh for the scene node.
Caspian wrote:I looked into custom scene nodes, and I really don't want to dive into specifying all the triangles myself
Then the best thing to do is to find or make a model of a cylinder and use that.
Caspian wrote:especially since my cylinder will be stretching and rotating
Scale and rotation can be done independently from the mesh. If you are going to scale and rotate the cylinder often, you would make a single cylinder primitive that has fixed dimensions [say a diameter of 1 and a length of 1]. If you wanted to make the diameter grow, you would apply a scale factor to the scene node that holds the mesh. So to make the cylinder 2x as tall, you set the scale to core::vector3df(1, 2, 1).

Travis
Caspian
Posts: 15
Joined: Sun Mar 18, 2007 2:38 am

Post by Caspian »

Thanks, vitek!

I created a cylinder using Blender and imported it (it was easier than I thought!)

I had thought that for something as simple as a cylinder I wouldn't need a "custom" scene node... but, oh well ;)

Thanks for your help :D.
Post Reply