hmmm Nothing
it always says: "The DLL call failed to execute".
I've tried now to check if the DLL call exists and I've put it with and without the "(" and ")"....I'm confused...anyway here's the code.
Notice that this part
if dll call exist(1,"EZro_Set()")
gosub ttt1
else
gosub ttt2
endif
checks if the DLL call exists...doesn't work, always return 0
Here's the complete code:
`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
if dll call exist(1,"EZro_Set()")
gosub ttt1
else
gosub ttt2
endif
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,"EZro_Set()",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,"EZro_GX",1
IF mode = 2 THEN call dll 1,"EZro_LX",1
ENDIF
IF DOWNKEY() = 1
IF mode = 1 THEN call dll 1,"EZro_GX",-1
IF mode = 2 THEN call dll 1,"EZro_LX",-1
ENDIF
`Rotate Y Axis
IF RIGHTKEY() = 1
IF mode = 1 THEN call dll 1,"EZro_GY",1
IF mode = 2 THEN call dll 1,"EZro_LY",1
ENDIF
IF LEFTKEY() = 1
IF mode = 1 THEN call dll 1,"EZro_GY",-1
IF mode = 2 THEN call dll 1,"EZro_LY",-1
ENDIF
`Rotate Z Axis
IF INKEY$() = "+"
IF mode = 1 THEN call dll 1,"EZro_GZ",1
IF mode = 2 THEN call dll 1,"EZro_LZ",1
ENDIF
if INKEY$() = "-"
IF mode = 1 THEN call dll 1,"EZro_GZ",-1
IF mode = 2 THEN call dll 1,"EZro_LZ",-1
ENDIF
IF SPACEKEY() = 1 THEN call dll 1,"EZro_Set",0,0,0
`Set Object to EZrotate's calculated rotation
rem t1=call dll(1,"EZro_GetX")
rem t2=call dll(1,"EZro_GetY")
rem t3=call dll(1,"EZro_GetZ")
rem ROTATE OBJECT 1,t1,t2,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,"EZro_GetX")
a2=call dll(1,"EZro_GetY")
a3=call dll(1,"EZro_GetZ")
b1=call dll(1,"EZro_GetMatXX")
b2=call dll(1,"EZro_GetMatXY")
b3=call dll(1,"EZro_GetMatXZ")
c1=call dll(1,"EZro_GetMatYX")
c2=call dll(1,"EZro_GetMatYY")
c3=call dll(1,"EZro_GetMatYZ")
d1=call dll(1,"EZro_GetMatZX")
d2=call dll(1,"EZro_GetMatZY")
d3=call dll(1,"EZro_GetMatZZ")
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
ttt1:
do
set cursor 0,0
print "it exists!"
sync
loop
ttt2:
do
set cursor 0,0
print "doesn't exists"
sync
loop