CreateCylinder ( [segments][,parent][,solid] )
Parameters:
| segments (optional) - cylinder detail. Defaults to 8. parent (optional) - parent entity of cylinder solid (optional) - true for a cylinder, false for a tube. Defaults to true. |
Description:
| Creates a cylinder mesh/entity and returns its handle. The cylinder will be centred at 0,0,0 and will have a radius of 1. The segments value must be in the range 3-100 inclusive, although this is only checked in debug mode. A common mistake is to leave debug mode off and specify the parent parameter (usually an eight digit memory address) in the place of the segments value. As the amount of polygons used to create a cylinder is exponentially proportional to the segments value, this will result in Blitz trying to create a cylinder with unimaginable amounts of polygons! Depending on how unlucky you are, your computer may then crash. Example segments values (solid=true): The
optional parent parameter allow you to specify a parent entity for the
cylinder so that when the parent is moved the child cylinder will move with
it. However, this relationship is one way; applying movement commands to the
child will not affect the parent. Specifying a parent entity will still result in the cylinder being
created at position 0,0,0 rather than at the parent entity's position. See also:
CreateCube,
CreateSphere, CreateCone. |
| ; CreateCylinder Example ; ---------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() light=CreateLight() RotateEntity light,90,0,0 ; Create cylinder cylinder=CreateCylinder() PositionEntity cylinder,0,0,5 While Not KeyDown( 1 ) RenderWorld Flip Wend End |