here is what I used that code for
RUBE GOLDBERG MAKER
have a go and let me know what you think.
`---------------------------------------<< RUBE GOLDBERG MAKER V 1.0>>-----------------------------------------------------
`---------------------------------------------<< By Sindore >>--------------------------------------------------------------
`---------------------------------------------<< 20,09,2008 >>--------------------------------------------------------------
`*** set sync ***
sync on :sync rate 60
`*** start physic ***
phy start
`*** set up backdrop ***
backdrop on
color backdrop rgb(100,100,100)
`*** camera setup ***
autocam off
position camera 0,0,80,-20 :`x625
xrotate camera 0,45
SET CAMERA RANGE 1,100000
`xrotate camera 0,45
`*** set up fog ***
fog on
fog color rgb(100,100,100)
fog distance 5000
`*** ambient light ***
set ambient light 100
`color ambient light rgb(rnd(255),rnd(255),rnd(255))
`*** mouse values ***
type Mouse_values
Mxpos# as integer
Mypos# as integer
Mzpos# as integer
Mxmove as float
Mymove as float
Mzmove as float
Mobjx# as integer
Mobjy# as integer
Mobjz# as integer
mouse_click as boolean
endtype
global Mouse as Mouse_values
`*** object values ***
type Object_Values
xpos# as integer
ypos# as integer
zpos# as integer
xang# as integer
yang# as integer
zang# as integer
xsize# as integer
ysize# as integer
zsize# as integer
red as float
green as float
blue as float
`mesh as float
total_obj as float
Load_Object$ as string
Phy_Mesh$ as string
endtype
dim Array(1000) as Object_Values
`*** make a floor object ***
make object cube 1001,1
scale object 1001,500000,10,500000
position object 1001,0,-20,0
color object 1001,rgb(255,255,255)
set object specular 1001, rgb(255,255,255)
set object specular power 1001, 255
set object ambient 1001,0
phy make rigid body static box 1001
`*** make mouse/raycast object ***
rco = 1002
make object sphere rco,5
set object rco,0,1,1
color object rco,rgb(0,0,0)
set object specular rco, rgb(0,0,0)
set object specular power rco, 0
set object ambient rco,0
`*** height indicater ***
rcoh = 1004
make object sphere rcoh,2
set object rcoh,0,1,1
color object rcoh,rgb(255,0,0)
set object specular rcoh, rgb(255,0,0)
set object specular power rcoh, 255
set object ambient rcoh,0
ghost object on rcoh,4
`place mead object height setter
moph# = 10.0
`*** make mesh objects ***
gosub make_mesh_object
`*** start the loop ***
do
`*** colour ink black ***
if ict = 0 then ct1 = 0
if ict = 255 then ct1 = 1
if ct1 = 0 then inc ict,1
if ct1 = 1 then dec ict,1
ink rgb(ict,ict,ict),0
`*** frams per second ***
FPS = screen fps()
`*** mouse values ***
Mouse.mouse_click = mouseclick()
Mouse.Mxpos# = mousex()
Mouse.Mypos# = mousey()
Mouse.Mxmove = mousemovex()
Mouse.Mymove = mousemovey()
`*** print outs ***
set cursor 0,380 : print "fps: ";screen fps()
`*** instrctions for play ***
set cursor 0,0 : print "ues numbers 1 - 5 to change objects, - and + to change height, and 0 to edit"
set cursor 0,20 : print "left button mouse to make an object, right mouse button to delete object"
set cursor 0,40 : print "press & hold the space ber to move the camera, press return key to pause physic"
set cursor 0,60 : print "object number: ";ID :`this is the number of objects made
set cursor 0,80 : print "object made: ";Array(ID).Load_Object$ :`this will tell you what object has bin made
remstart
`(((((((((((((((((((((((( you can add this print out in, to see how it all works. )))))))))))))))))))))))))))))
`*** ray cast read outs ***
set cursor 0,100 :print "ray cast object: ";obj
set cursor 0,120 :print "ray cast distance: ";grcd#
`*** object pick read outs
set cursor 0,140 :print "object picker: ";po
set cursor 0,160 :print "pick distance: ";gpd#
`*** object creation read outs ***
set cursor 0,180 : print "make height: ";moph#
set cursor 0,200 : print "scan code: ";scancode()
remend
`*** set the height of the objects creation ***
if Edit_object = 0
if scancode() = 12 then dec moph#,0.5
if scancode() = 13 then inc moph#,0.5
if moph# <= 5.0 then moph# = 5.0
if moph# >= 100.0 then moph# = 100.0
endif
`************************************************************************
`***************** this is to edit the object rotation, position, size **
`************************************************************************
`*** EDIT object made position rotation ***
if scancode() = 11 and Edit_object = 0
et = 0
off_swich = 0
if obj > 0 and obj < 1001 :`this stops you from editing the floor
SelObj = obj
Edit_object = 1 :` ID_object_picker = 0
endif
endif
`*** edit object position and rotation ***
if Edit_object = 1
`*** check to see if the object exists or not ***
if object exist(SelObj) = 1
if phy get rigid body exist(SelObj) = 1 then phy delete rigid body SelObj :` this delete physic from the object
if scancode() = 19 and rot1 = 0 then rot1 = 1 :`R this is on swich for rotation
if scancode() = 25 and pos1 = 0 then pos1 = 1 :`P this is on swich for positioning
if scancode() = 31 and size1 = 0 then size1 = 1 :`S this is on swich for scaling
if scancode() = 45 and Xset = 0 then Xset = 1 :`X
if scancode() = 21 and Yset = 0 then Yset = 1 :`Y
if scancode() = 44 and Zset = 0 then Zset = 1 :`Z
`*** this for rotation ***
if rot1 = 1 :`and pos1 = 0 and size1 = 0
`*** X rotate ***
if Xset = 1 then Array(SelObj).xang# = wrapvalue(object angle x(SelObj)+Mouse.Mymove*0.5)
`*** Y rotate ***
if Yset = 1 then Array(SelObj).yang# = wrapvalue(object angle y(SelObj)+Mouse.Mxmove*0.5)
`*** Z rotate ***
if Zset = 1 then Array(SelObj).zang# = wrapvalue(object angle z(SelObj)+Mouse.Mxmove*0.5)
`*** update rotation ***
rotate object SelObj,Array(SelObj).xang#,Array(SelObj).yang#,Array(SelObj).zang#
endif
`*** this is for positioning ***
if pos1 = 1 :`and pos1 = 0 and size1 = 0
`*** set y position ***
if scancode() = 12 then dec Yedit#,0.5
if scancode() = 13 then inc Yedit#,0.5
`*** X position ***
if Xset = 1 then Array(SelObj).xpos# = object position x(rco)
`*** Y position ***
if Yset = 1 then Array(SelObj).ypos# = object position y(rco)+Yedit#
`*** Z position ***
if Zset = 1 then Array(SelObj).zpos# = object position z(rco)
`*** update position ***
position object SelObj,Array(SelObj).xpos#,Array(SelObj).ypos#,Array(SelObj).zpos#
endif
`*** this is for scaling ***
if size1 = 1 :`and pos1 = 0 and size1 = 0
`*** X scale ***
if Xset = 1
if scancode() = 12 then dec Array(SelObj).xsize#,10.0 :`= object size x(SelObj)
if scancode() = 13 then inc Array(SelObj).xsize#,10.0
endif
`*** Y scale ***
if Yset = 1
if scancode() = 12 then dec Array(SelObj).ysize#,10.0 :`object size y(SelObj)
if scancode() = 13 then inc Array(SelObj).ysize#,10.0
endif
`*** Z scale ***
if Zset = 1
if scancode() = 12 then dec Array(SelObj).zsize#,10.0 :`object size z(SelObj)
if scancode() = 13 then inc Array(SelObj).zsize#,10.0
endif
`*** update scale ***
scale object SelObj,Array(SelObj).xsize#,Array(SelObj).ysize#,Array(SelObj).zsize#
endif
endif
`*** ***
inc et
if et >= 25 then et = 25
if scancode() = 11 and et = 25
off_swich = 1
rot1 = 0 :`this is off swich for rotation
pos1 = 0 :`this is off swich for position
size1 = 0 :`this is off swich for scale
Xset = 0
Yset = 0
Zset = 0
endif
`*** ***
if off_swich = 1
`*** print outs ***
set cursor 0,400 : print "dynamic box physic press 1"
set cursor 0,420 : print "dynamic sphere physic press 2"
set cursor 0,440 : print "static mesh physic press 3"
`*** remake physic ***
if scancode() = 2 then phy make rigid body dynamic box ID : Edit_object = 0
if scancode() = 3 then phy make rigid body dynamic sphere ID : Edit_object = 0
if scancode() = 4 then phy make rigid body static mesh ID : Edit_object = 0
else
set cursor 0,400 : print "to rotate object press R key: ";rot1;" X ";Xset;" Y ";Yset;" Z ";Zset
set cursor 0,420 : print "to position object press P key: ";pos1;" X ";Xset;" Y ";Yset;" Z ";Zset
set cursor 0,440 : print "to scale object press S key: ";size1;" X ";Xset;" Y ";Yset;" Z ";Zset
endif
endif
`************************************************************************
`******************* this is the end of the editer **********************
`************************************************************************
`*************************************************************************************************************************
`*************************************************************************************************************************
`*********************************************** this is the ray cast controls *******************************************
`*************************************************************************************************************************
`*************************************************************************************************************************
`*** picks ***
po = pick object(Mouse.Mxpos#,Mouse.Mypos#,1,1001)
gpd# = get pick distance()
pick screen Mouse.Mxpos#,Mouse.Mypos#,0.99 :`0.99 this is the key to smothness of mouse ray cast cursor
`*** camera position ***
camx# = camera position x()
camy# = camera position y()
camz# = camera position z()
`*** position ray cast object ***
position object rco,camx#,camy#,camz#
`*** ray cast object position ***
rayx# = object position x(rco) :`102
rayy# = object position y(rco)
rayz# = object position z(rco)
`*** old vectors ***
gpvx# = get pick vector x() :`I must add that this is the 1st time I have ever uesd the pick commands in my code.
gpvy# = get pick vector y() :`and I think I like how they work with raycasting to come up with such a good resoult.
gpvz# = get pick vector z()
`*** ray cast object orientation ***
set object to camera orientation rco
move object rco, 1
`Work out x,y,z vectors by just subtracting the old position from the new position
xvec# = object position x(rco) - rayx#
yvec# = object position y(rco) - rayy#
zvec# = object position z(rco) - rayz#
`*** new vectors ***
newgpvx# = get pick vector x() - gpvx#
newgpvy# = get pick vector y() - gpvy#
newgpvz# = get pick vector z() - gpvz#
`*** old vectors ***
rayvec1X# = (rayx# + gpvx# * gpd#) :`this is where all the magic happens, look at the code above to see how this works
rayvec1Y# = (rayy# + gpvy# * gpd#)
rayvec1Z# = (rayz# + gpvz# * gpd#)
`*** new vectors ***
rayvec2X# = (xvec# + newgpvx# * gpd#)
rayvec2Y# = (yvec# + newgpvy# * gpd#)
rayvec2Z# = (zvec# + newgpvz# * gpd#)
`*** get closest shape ***
ray = phy ray cast closest shape ( rayvec1X#,rayvec1Y#,rayvec1Z#,rayvec2X#,rayvec2Y#,rayvec2Z# )
obj = phy get ray cast object ()
grcd# = phy get ray cast distance()
`*** ray cast hit point ***
grchpx# = phy get ray cast hit point x ( )
grchpy# = phy get ray cast hit point y ( )
grchpz# = phy get ray cast hit point z ( )
`*** position ray cast object at ray cast position ***
position object rco,phy get ray cast hit point x ( ),phy get ray cast hit point y ( ),phy get ray cast hit point z ( )
`*************************************************************************************************************************
`*************************************************************************************************************************
`********************************************* this is the end ray cast controls *****************************************
`*************************************************************************************************************************
`*************************************************************************************************************************
`*** object maker cube sphere etc ***
if scancode() = 2 :`cube
ID_object_picker = 1
for c = 1 to 1000
Array(c).xsize# = 1000 :`XYZ size#
Array(c).ysize# = 1000
Array(c).zsize# = 1000
Array(c).red = 0 :`red colour
Array(c).green = 0 :`green colour
Array(c).blue = 255 :`blue colour
next c
endif
if scancode() = 3 :`sphere
ID_object_picker = 2
for c = 1 to 1000
Array(c).xsize# = 1250 :`XYZ size#
Array(c).ysize# = 1250
Array(c).zsize# = 1250
Array(c).red = 255 :`red colour
Array(c).green = 0 :`green colour
Array(c).blue = 0 :`blue colour
next c
endif
if scancode() = 4 :`ramp 1
ID_object_picker = 3
for c = 1 to 1000
Array(c).xsize# = 1100 :`XYZ size#
Array(c).ysize# = 1100
Array(c).zsize# = 1100
Array(c).red = 0 :`red colour
Array(c).green = 255 :`green colour
Array(c).blue = 0 :`blue colour
next c
endif
if scancode() = 5 :`ramp 2
ID_object_picker = 4
for c = 1 to 1000
Array(c).xsize# = 1000 :`XYZ size#
Array(c).ysize# = 1000
Array(c).zsize# = 1000
Array(c).red = 255 :`red colour
Array(c).green = 0 :`green colour
Array(c).blue = 255 :`blue colour
next c
endif
if scancode() = 6 :`gun
ID_object_picker = 5
for c = 1 to 1000
Array(c).xsize# = 500 :`XYZ size#
Array(c).ysize# = 500
Array(c).zsize# = 500
Array(c).red = 0 :`red colour
Array(c).green = 255 :`green colour
Array(c).blue = 255 :`blue colour
next c
endif
remstart
if scancode() = 7
ID_object_picker = 6
for c = 1 to 1000
Array(c).xsize# = 1100 :`XYZ size#
Array(c).ysize# = 1100
Array(c).zsize# = 1100
next c
endif
remend
`*** object valeus ***
for c = 1 to 1000
if object exist(c) = 1
Array(c).xpos# = object position x(c) :`XYZ pos#
Array(c).ypos# = object position y(c)
Array(c).zpos# = object position z(c)
Array(c).xang# = object angle x(c) :`XYZ ang#
Array(c).yang# = object angle y(c)
Array(c).zang# = object angle z(c)
endif
next c
`*** make objects ***
if Mouse.mouse_click = 1 and Edit_object = 0 then on_off = 1
if on_off = 1
inc ID_timer :`this is to count down the ID timer, its used so that you don`t build object apone objects the same place
`however if you keep the ray in the same place, you can make an object in the same position
if ID_timer = 25 then ID_timer = 0 : on_off = 0 :`this is the swich off for the timer.
OldID = ID :`store the old ID number in OldID
if ID < 1000 and ID_timer = 1 then inc ID
if OldID < ID and ID_timer = 1 and ID_object_picker > 0
if object exist(ID) = 0
Load_Object(ID_object_picker,ID)
color object ID,rgb(Array(ID).red,Array(ID).green,Array(ID).blue)
set object specular ID,rgb(Array(ID).red,Array(ID).green,Array(ID).blue)
set object specular power ID,255
set object ambient ID,0
position object ID,object position x(rco),object position y(rco)+moph#,object position z(rco)
scale object ID,Array(ID).xsize#,Array(ID).ysize#,Array(ID).zsize#
if ID_object_picker = 1 then phy make rigid body dynamic box ID
if ID_object_picker = 2 then phy make rigid body dynamic sphere ID
if ID_object_picker = 3 or ID_object_picker = 4 then phy make rigid body static mesh ID
if ID_object_picker = 5 then phy make rigid body dynamic box ID :`phy make rigid body dynamic mesh ID
endif
endif
endif
`*** rcoh this will show the height at which the physic objects are made ***
position object rcoh,object position x(rco),object position y(rco)+moph#,object position z(rco)
`*** delete objects and reset scene ***
if Mouse.mouse_click = 2 and Edit_object = 0
if obj < 1001
if object exist(obj) = 1
phy delete rigid body obj
delete object obj
dec ID
endif
endif
`ID = 0
endif
`*** camera control ***
if spacekey() = 1
camera_control()
endif
`*** pause physics ***
if returnkey() = 1 and pause = 0 then pause = 1 :`197
if pause = 1
inc count
if count > 25
if returnkey() = 1 then pause = 0
endif
else
count = 0
phy update
endif
`*** end loop ***
sync
loop
phy end
end
`*** camera control ***
function camera_control()
CamAngY# = camera angle y()
CamAngX# = camera angle x()
CamAngZ# = camera angle z()
posX# = camera position x()
posY# = camera position y()
posZ# = camera position z()
CamAngY# = wrapvalue(CamAngY# + Mouse.Mxmove*0.1)
CamAngX# = wrapvalue(CamAngX# + Mouse.Mymove*0.1)
rem stops mouse from going upside down
if wrapvalue(CamAngX#)>100 and wrapvalue(CamAngX#)<120 then CamAngX# = 100
if wrapvalue(CamAngX#)>180 and wrapvalue(CamAngX#)<280 then CamAngX# = 280
`forword
if upkey() = 1 or keystate(17) = 1
inc posX#,sin(CamAngY#)*2.5
inc posz#,cos(CamAngY#)*2.5
` this is for y pos +
if CamAngX# > sin(CamAngX#)
dec posY#,sin(CamAngX#)*2.5
endif
` this is for y pos -
if CamAngX# < cos(CamAngX#)
inc posY#,cos(CamAngX#)*2.5
endif
endif
` backword
IF downkey() = 1 or keystate(31) = 1
dec posX#,sin(CamAngY#)*2.5
dec posZ#,cos(CamAngY#)*2.5
` this is for y pos +
if CamAngX# > sin(CamAngX#)
inc posY#,sin(CamAngX#)*2.5
endif
` this is for y pos -
if CamAngX# < cos(CamAngX#)
dec posY#,cos(CamAngX#)*2.5
endif
endif
`side step right
if rightkey() = 1 or KeyState(32) = 1
inc posX#,cos(CamAngY#)*2.5
inc posZ#,-sin(CamAngY#)*2.5
endif
`side step left
if leftkey() = 1 or KeyState(30) = 1
dec posX#,cos(CamAngY#)*2.5
dec posZ#,-sin(CamAngY#)*2.5
endif
rotate camera CamAngX#,CamAngY#,CamAngZ#
position camera posX#,posY#,posZ#
endfunction
`*** load object ***
function Load_Object(ID_object_picker,ID)
if ID_object_picker = 0 then exitfunction
if ID_object_picker = 1
make object cube ID,1
Array(ID).Load_Object$ = "Cube"
endif
if ID_object_picker = 2
make object sphere ID,1
Array(ID).Load_Object$ = "Sphere"
endif
if ID_object_picker = 3
`make object cone ID,1
make object ID,1,0
set object ID,1,1,0
Array(ID).Load_Object$ = "Ramp 1":`"Cylinder"
endif
if ID_object_picker = 4
`make object cone ID,1
make object ID,2,0
set object ID,1,1,0
Array(ID).Load_Object$ = "Ramp 2":`"Cylinder"
endif
if ID_object_picker = 5
make object ID,3,0
set object ID,1,1,0
Array(ID).Load_Object$ = "Gun 1":`"Cylinder"
endif
remstart
if ID_object_picker = 6
`make object cone ID,1
make object ID,4,0
`hide limb ID,0
set object ID,1,1,0
Array(ID).Load_Object$ = "Ramp 1":`"Cylinder"
endif
remend
endfunction
`*** ***
`function make_mesh_object()
make_mesh_object:
mesh = 1
mobj1 = 1003
`*** make ramp 1 ***
make object cube mobj1,1
make mesh from object mesh,mobj1
scale limb mobj1,0,150,100,100
add limb mobj1,1,mesh
offset limb mobj1,1,0.75,0.21,0
rotate limb mobj1,1,0,0,45
add limb mobj1,2,mesh
offset limb mobj1,2,-0.75,0.21,0
rotate limb mobj1,2,0,0,-45
delete mesh mesh
scale object mobj1,100,100,1000
make mesh from object mesh,mobj1
delete object mobj1
mesh = 2
`*** make ramp 4 ***
make object cube mobj1,1
make mesh from object mesh,mobj1
scale limb mobj1,0,100,12.5,100
add limb mobj1,1,mesh
scale limb mobj1,1,12.5,200,100
offset limb mobj1,1,-0.5,0.5,0
add limb mobj1,2,mesh
scale limb mobj1,2,12.5,200,100
offset limb mobj1,2,0.5,0.5,0
scale object mobj1,750,100,1000
make mesh from object mesh,mobj1
delete object mobj1
mesh = 3
`*** make gun ***
` make centeral object
make object cube 1,1
`*** make mesh object ***
make object cylinder 2,1
make mesh from object mesh,2
delete object 2
` mid big barrel
add limb 1,1,mesh
scale limb 1,1,150,375,150
offset limb 1,1,0,0,2.75
rotate limb 1,1,90,0,0
` top small barrel
add limb 1,2,mesh
scale limb 1,2,25,350,25
offset limb 1,2,0,0.9,2
rotate limb 1,2,90,0,0
` bottom small barrel
add limb 1,3,mesh
scale limb 1,3,25,350,25
offset limb 1,3,0,-0.9,2
rotate limb 1,3,90,0,0
` right small barrel
add limb 1,4,mesh
scale limb 1,4,25,350,25
offset limb 1,4,0.9,0,2
rotate limb 1,4,90,0,0
` left small barrel
add limb 1,5,mesh
scale limb 1,5,25,350,25
offset limb 1,5,-0.9,0,2
rotate limb 1,5,90,0,0
`*** delete mesh ***
delete mesh mesh
`*** make mesh object ***
make object sphere 2,1
make mesh from object mesh,2
delete object 2
` gun center sphere
add limb 1,6,mesh
scale limb 1,6,225,225,225
` gun holder end of barrel
add limb 1,7,mesh
scale limb 1,7,225,225,50
offset limb 1,7,0,0,3
` gun holder mid of barrel
add limb 1,8,mesh
scale limb 1,8,225,225,50
offset limb 1,8,0,0,3.75
` gun holder of gunbut
add limb 1,9,mesh
scale limb 1,9,225,225,50
offset limb 1,9,0,0,0.75
`*** delete mesh ***
delete mesh mesh
`*** make mesh object ***
make object cone 2,1
make mesh from object mesh,2
delete object 2
` big cone barrel
add limb 1,10,mesh
scale limb 1,10,155,100,155
offset limb 1,10,0,0,4.15
rotate limb 1,10,-90,0,0
` small cone barrel
add limb 1,11,mesh
scale limb 1,11,100,25,100
offset limb 1,11,0,0,4.15
rotate limb 1,11,90,0,0
`*** delete mesh ***
delete mesh mesh
`*** make mesh object ***
make object cube 2,1
make mesh from object mesh,2
delete object 2
` gun body
add limb 1,12,mesh
scale limb 1,12,50,150,250
offset limb 1,12,0,0.25,-1.5
` gun handal
add limb 1,13,mesh
scale limb 1,13,25,150,50
offset limb 1,13,0,-1,-1.3
rotate limb 1,13,15,0,0
` gun butt base
add limb 1,14,mesh
scale limb 1,14,85,200,25
offset limb 1,14,0,0.05,-2.75
` gun body detail cube right
add limb 1,15,mesh
scale limb 1,15,10,75,250
offset limb 1,15,0.3,0.4,-1.5
` gun body detail cube right
add limb 1,16,mesh
scale limb 1,16,10,75,250
offset limb 1,16,-0.3,0.4,-1.5
` gun butt tip
add limb 1,17,mesh
scale limb 1,17,85,50,25
offset limb 1,17,0,1.15,-2.90
rotate limb 1,17,-45,0,0
` gun sight base
add limb 1,18,mesh
scale limb 1,18,25,50,125
offset limb 1,18,0,1.25,0
` gun sight
add limb 1,19,mesh
scale limb 1,19,35,35,200
offset limb 1,19,0,1.5,0
rotate limb 1,19,0,0,45
` gun sight back lip
add limb 1,20,mesh
scale limb 1,20,55,55,10
offset limb 1,20,0,1.5,-1
rotate limb 1,20,0,0,45
` gun sight funt lip
add limb 1,21,mesh
scale limb 1,21,55,55,75
offset limb 1,21,0,1.5,1.25
rotate limb 1,21,0,0,45
`*** delete mesh ***
delete mesh mesh
`*** make mesh object ***
make object cylinder 2,1
make mesh from object mesh,2
delete object 2
` gun frunt sight hole
add limb 1,22,mesh
scale limb 1,22,50,50,50
offset limb 1,22,0,1.5,1.75
rotate limb 1,22,90,0,0
` gun back sight hole
add limb 1,23,mesh
scale limb 1,23,50,25,50
offset limb 1,23,0,1.5,-1.15
rotate limb 1,23,90,0,0
` gun body detail cylinder right
add limb 1,24,mesh
scale limb 1,24,50,150,50
offset limb 1,24,0.3,0.4,-1.5
rotate limb 1,24,90,0,0
` gun body detail cylinder left
add limb 1,25,mesh
scale limb 1,25,50,150,50
offset limb 1,25,-0.3,0.4,-1.5
rotate limb 1,25,90,0,0
` gun triger
add limb 1,26,mesh
scale limb 1,26,50,25,100
offset limb 1,26,0,-0.85,-0.9
rotate limb 1,26,0,0,90
`*** delete mesh ***
delete mesh mesh
`*** make mesh object ***
make object cone 2,1
make mesh from object mesh,2
delete object 2
` gun sight hole back cone
add limb 1,27,mesh
scale limb 1,27,50,25,50
offset limb 1,27,0,1.5,-1.15
rotate limb 1,27,90,0,0
` gun sight hole frunt cone
add limb 1,28,mesh
scale limb 1,28,50,25,50
offset limb 1,28,0,1.5,1.75
rotate limb 1,28,-90,0,0
` gun body detail cone right
add limb 1,29,mesh
scale limb 1,29,50,50,50
offset limb 1,29,0.3,0.4,-2.5
rotate limb 1,29,-90,0,0
` gun body detail cone left
add limb 1,30,mesh
scale limb 1,30,50,50,50
offset limb 1,30,-0.3,0.4,-2.5
rotate limb 1,30,-90,0,0
`*** delete mesh ***
delete mesh mesh
`*** make mesh object ***
make object sphere 2,1
make mesh from object mesh,2
delete object 2
` gun handale tip
add limb 1,31,mesh
scale limb 1,31,30,40,75
offset limb 1,31,0,-1.75,-1.5
rotate limb 1,31,15,0,0
` gun hilt padding top
add limb 1,32,mesh
scale limb 1,32,90,50,50
offset limb 1,32,0,0.85,-2.85
` gun hilt padding mid 1
add limb 1,33,mesh
scale limb 1,33,90,50,50
offset limb 1,33,0,0.45,-2.85
` gun hilt padding mid 2
add limb 1,34,mesh
scale limb 1,34,90,50,50
offset limb 1,34,0,0.05,-2.85
` gun hilt padding mid 3
add limb 1,35,mesh
scale limb 1,35,90,50,50
offset limb 1,35,0,-0.325,-2.85
` gun hilt padding mid 4
add limb 1,36,mesh
scale limb 1,36,90,50,50
offset limb 1,36,0,-0.75,-2.85
`*** delete mesh ***
delete mesh mesh
`************************************************************************************
`*** replace the object so that it can be used in dark physics as a dinamic body. ***
`************************************************************************************
make mesh from object mesh,1
delete object 1
return
`endfunction mesh1
soul sucking devils, twisted body of the damed, slivering slim drips from every poor, sin licking at your ears, and the smell stinging your eyes, and if you don't like it, get out of my kitchen!