Quote: "they *should* work"
Man!! they worked!, now the "call dll" function doesn't return 0 anymore! but...the cube doesn't rotate
....any help?
`EZrotate sample program
`March-9-2004
`Written by: Ron Erickson
`http://www.ericksonline.com
SYNC ON
SYNC RATE 0
`Main Cube Object
MAKE OBJECT CUBE 1,1
`Create Global Axis
`--------------------------
`X axis
MAKE OBJECT CYLINDER 2,.1
SCALE OBJECT 2,100,2000,100
POSITION OBJECT 2,1,0,0
ROTATE OBJECT 2,0,0,270
COLOR OBJECT 2,RGB(255,0,0)
`Y axis
MAKE OBJECT CYLINDER 3,.1
SCALE OBJECT 3,100,2000,100
POSITION OBJECT 3,0,1,0
COLOR OBJECT 3,RGB(0,255,0)
`Z axis
MAKE OBJECT CYLINDER 4,.1
SCALE OBJECT 4,100,2000,100
POSITION OBJECT 4,0,0,1
ROTATE OBJECT 4,90,0,0
COLOR OBJECT 4,RGB(0,0,255)
`Create Local Axis
`--------------------------
`X axis
MAKE OBJECT CYLINDER 5,.1
SCALE OBJECT 5,100,2000,100
MAKE MESH FROM OBJECT 1,5
DELETE OBJECT 5
ADD LIMB 1,1,1
OFFSET LIMB 1,1,1,0,0
ROTATE LIMB 1,1,0,0,wrapvalue(-90)
COLOR LIMB 1,1,RGB(100,0,0)
`Y axis
MAKE OBJECT CYLINDER 5,.1
SCALE OBJECT 5,100,2000,100
MAKE MESH FROM OBJECT 2,5
DELETE OBJECT 5
ADD LIMB 1,2,2
OFFSET LIMB 1,2,0,1,0
COLOR LIMB 1,2,RGB(0,100,0)
`Z axis
MAKE OBJECT CYLINDER 5,.1
SCALE OBJECT 5,100,2000,100
MAKE MESH FROM OBJECT 3,5
DELETE OBJECT 5
ADD LIMB 1,3,3
OFFSET LIMB 1,3,0,0,1
ROTATE LIMB 1,3,90,0,0
COLOR LIMB 1,3,RGB(0,0,100)
`Camera
POSITION CAMERA -5,5,-5
POINT CAMERA 0,0,0
mode = 1
LOAD DLL "ezrotate.dll",1
DO
`Set EZrotate to objects current angle
ax#=OBJECT ANGLE X(1)
ay#=OBJECT ANGLE Y(1)
az#=OBJECT ANGLE Z(1)
call dll 1,"?EZrotate_Set@@YAXNNN@Z",ax#,ay#,az#
IF INKEY$() = "1" THEN mode = 1
IF INKEY$() = "2" THEN mode = 2
`Rotate X Axis
IF UPKEY() = 1
IF mode = 1 THEN call dll 1,"?EZrotate_GX@@YAXN@Z",1
IF mode = 2 THEN call dll 1,"?EZrotate_LX@@YAXN@Z",1
ENDIF
IF DOWNKEY() = 1
IF mode = 1 THEN call dll 1,"?EZrotate_GX@@YAXN@Z",-1
IF mode = 2 THEN call dll 1,"?EZrotate_LX@@YAXN@Z",-1
ENDIF
`Rotate Y Axis
IF RIGHTKEY() = 1
IF mode = 1 THEN call dll 1,"?EZrotate_GY@@YAXN@Z",1
IF mode = 2 THEN call dll 1,"?EZrotate_LY@@YAXN@Z",1
ENDIF
IF LEFTKEY() = 1
IF mode = 1 THEN call dll 1,"?EZrotate_GY@@YAXN@Z",-1
IF mode = 2 THEN call dll 1,"?EZrotate_LY@@YAXN@Z",-1
ENDIF
`Rotate Z Axis
IF INKEY$() = "+"
IF mode = 1 THEN call dll 1,"?EZrotate_GZ@@YAXN@Z",1
IF mode = 2 THEN call dll 1,"?EZrotate_LZ@@YAXN@Z",1
ENDIF
if INKEY$() = "-"
IF mode = 1 THEN call dll 1,"?EZrotate_GZ@@YAXN@Z",-1
IF mode = 2 THEN call dll 1,"?EZrotate_LZ@@YAXN@Z",-1
ENDIF
IF SPACEKEY() = 1 THEN call dll 1,"?EZrotate_Set@@YAXNNN@Z",0,0,0
`Set Object to EZrotate's calculated rotation
t1=call dll(1,"?EZrotate_GetX@@YANXZ")
t2=call dll(1,"?EZrotate_GetY@@YANXZ")
t3=call dll(1,"?EZrotate_GetZ@@YANXZ")
ROTATE OBJECT 1,wrapvalue(t1),wrapvalue(t2),wrapvalue(t3)
SET CURSOR 0,0
PRINT screen fps()
PRINT "EZ-Rotate Full version"
PRINT "By: ericksonline"
Print "visit: www.ericksonline.com"
PRINT " "
PRINT "Press 1 for Global Rotation"
PRINT "Press 2 for Local Rotation"
PRINT "---------------------------"
IF mode = 1 THEN PRINT "Current mode: Global"
IF mode = 2 THEN PRINT "Current mode: Local"
PRINT " X Rotation - Up and Down arrows"
PRINT " Y Rotation - Left and Right arrows"
PRINT " Z ROtation - + and - keys"
print " "
a1=call dll(1,"?EZrotate_GetX@@YANXZ")
a2=call dll(1,"?EZrotate_GetY@@YANXZ")
a3=call dll(1,"?EZrotate_GetZ@@YANXZ")
b1=call dll(1,"?EZrotate_GetMatXX@@YANXZ")
b2=call dll(1,"?EZrotate_GetMatXY@@YANXZ")
b3=call dll(1,"?EZrotate_GetMatXZ@@YANXZ")
c1=call dll(1,"?EZrotate_GetMatYX@@YANXZ")
c2=call dll(1,"?EZrotate_GetMatYY@@YANXZ")
c3=call dll(1,"?EZrotate_GetMatYZ@@YANXZ")
d1=call dll(1,"?EZrotate_GetMatZX@@YANXZ")
d2=call dll(1,"?EZrotate_GetMatZY@@YANXZ")
d3=call dll(1,"?EZrotate_GetMatZZ@@YANXZ")
PRINT "Euler X = " + str$(a1)
PRINT "Euler Y = " + str$(a2)
PRINT "Euler Z = " + str$(a3)
PRINT " "
PRINT "Matrix XX = " + str$(b1)
PRINT "Matrix XY = " + str$(b2)
PRINT "Matrix XZ = " + str$(b3)
PRINT "Matrix YX = " + str$(c1)
PRINT "Matrix YY = " + str$(c2)
PRINT "Matrix YZ = " + str$(c3)
PRINT "Matrix ZX = " + str$(d1)
PRINT "Matrix ZY = " + str$(d2)
PRINT "Matrix ZZ = " + str$(d3)
SYNC
LOOP
WOLF, you're a truly genious!