DarkBASIC Professional Help Wiki
Advertisement


This command will construct a 3D object from a sphere mesh.

Syntax
MAKE OBJECT SPHERE Object Number, Size
MAKE OBJECT SPHERE Object Number, Size, Rows, Columns
Parameters
Object Number

Integer
The object number Size Float
The size Rows Integer
The rows Columns Integer
The columns

Returns

This command does not return a value.

Description

The mesh is used as the root limb for the 3D object. The 3D object will be constructed untextured and such models will appear white when displayed. The parameters should be specified using integer values. Ensure what specifying additional resolution to the object, you do not exceed the maximum size allowed, which depends on the resulting vertex data required to create the object. Normally, a single limb within an object has a maximum size of 21845 polygons. Be aware that creating large object numbers reserves a large jump table in memory which may affect overall initialisation speed. Use small object numbers where possible.

Example Code
sync on

sync rate 120

hide mouse

cls 0

ObjectNumber=1

make object sphere ObjectNumber,10

color object ObjectNumber,rgb(0,0,255)

while mouseclick()=0

set cursor 0,0

if scancode()>1 and scancode()<8 then if object exist(ObjectNumber)=1 then delete object ObjectNumber

if inkey$()="1" then make object cube ObjectNumber,10:color object ObjectNumber,rgb(0,0,255)

if inkey$()="2" then make object box ObjectNumber,10,10,20:color object ObjectNumber,rgb(0,0,255)

if inkey$()="3" then make object cylinder ObjectNumber,10:color object ObjectNumber,rgb(0,0,255)

if inkey$()="4" then make object cone ObjectNumber,10:color object ObjectNumber,rgb(0,0,255)

if inkey$()="5" then make object plain ObjectNumber,10,10:color object ObjectNumber,rgb(0,0,255)

if inkey$()="6" then make object triangle ObjectNumber, 0, 0, 0, 5, 5, 0, 0, 5, 0:color object ObjectNumber,rgb(0,0,255)

xrotate object ObjectNumber,wrapvalue(object angle x(ObjectNumber)+1)

yrotate object ObjectNumber,wrapvalue(object angle y(ObjectNumber)+1)

sync

endwhile

delete object ObjectNumber

end
Advertisement