Create Capsule
Blitz3D Forums/Blitz3D Programming/Create Capsule
| ||
Somebody's done this before I think... Can I please have a code for making a capsule mesh that can be scaled without weird things happening? (ie. Consisting of one single object) |
| ||
I've only seen this torus function, maybe it's that one you think you saw. http://www.blitzbasic.com/codearcs/codearcs.php?code=1133 |
| ||
BlitzODE has some samples with Pill shaped objects, but I haven't taken a look at the code yet. Some pill objects are in 'ODE_Sample1.bb' if I remember right... |
| ||
But those where put together by CreateCylinder() and CreateSphere() i think. |
| ||
Is a mesh made in a 3d app not an option? |
| ||
Not exactly what you are looking for, but it could be a good start :) r# = radius h# = height of the cylinder part (I think) Function CreateCapsule(r#,h#) ent=CreateCylinder(8) ScaleMesh ent,r,h*.5,r s=CreateSphere(4):ScaleMesh s,r,r,r:PositionMesh s,0,h*.5,0:AddMesh s,ent:FreeEntity s s=CreateSphere(4):ScaleMesh s,r,r,r:PositionMesh s,0,-h*.5,0:AddMesh s,ent:FreeEntity s Return ent End Function |
| ||
hm... Lol. I can't believe I didn't think to make something in a 3d app. Don't mock my bufoonery! |