How to create capsule mesh ???

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
booe
Posts: 76
Joined: Thu Jul 29, 2010 2:12 pm

How to create capsule mesh ???

Post by booe »

How to create capsule mesh? There is nothing like this in CGeometryCreator ! I need both Index Buffers and Vertex Buffers with Texture Coordinates and Normals.
CuteAlien
Admin
Posts: 9679
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How to create capsule mesh ???

Post by CuteAlien »

Create a sphere and scale it. Real capsule (cylinder + 2 half-spheres) is not yet there I think, so you would have to do that yourself.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
booe
Posts: 76
Joined: Thu Jul 29, 2010 2:12 pm

Re: How to create capsule mesh ???

Post by booe »

Didnt think about it, lol.
Still, it would be cool to add "createCapsuleMesh" to CGeometryCreator.
gerdb
Posts: 194
Joined: Wed Dec 02, 2009 8:21 pm
Location: Dresden, Germany

Re: How to create capsule mesh ???

Post by gerdb »

maybe create 2 halfspheres from one full sphere or 2 skydomes and add a cylinder in the middle, if thats what you seek

EDIT: at least you have to recalculate UV-coords, but the big question is, how many textures shall be used 1,2 or 3?

the createSphereMesh in CGeometryCreator seems to separate indices in top and bottom half, so this would be easy to adapt,
just go the indices for top, save the vertices at these indices with added half cylinder height to cap-mesh, save vertices with substracted half cylinder height and finally the cylinder itself.
gerdb
Posts: 194
Joined: Wed Dec 02, 2009 8:21 pm
Location: Dresden, Germany

Re: How to create capsule mesh ???

Post by gerdb »

Post Reply