Create Capsule

Blitz3D Forums/Blitz3D Programming/Create Capsule

Picklesworth(Posted 2005) [#1]
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)


cermit(Posted 2005) [#2]
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


Erroneouss(Posted 2005) [#3]
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...


cermit(Posted 2005) [#4]
But those where put together by CreateCylinder() and CreateSphere() i think.


Jeroen(Posted 2005) [#5]
Is a mesh made in a 3d app not an option?


Paolo(Posted 2005) [#6]
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



Picklesworth(Posted 2005) [#7]
hm...
Lol. I can't believe I didn't think to make something in a 3d app.


Don't mock my bufoonery!