For the speed it's normal : the movement is not speed based, so it will be as fast as your computer can calculate it, i know it's not the good way to do it, but i don't care, it's just a test

it's done with my 3d engine, so it was also a little test of it (well, i haven't used a lot of it into it

). The commands are similar to blitz3d's one nd the concept is the same also
Here's the code of the demo (not optimized)
Code: Select all
Graphics3D(800,600,16,2)
Procedure MoveMouse(x,y)
SetCursorPos_(WindowX()+x,WindowY()+y)
EndProcedure
Procedure.f CurveValue(newvalue.f,oldvalue.f,increments.f)
If increments>1
oldvalue.f=oldvalue.f-(oldvalue.f-newvalue.f)/increments
EndIf
If increments<=1
oldvalue.f=newvalue
EndIf
ProcedureReturn oldvalue
EndProcedure
dParamLoStop = 0
dParamHiStop = 1
dParamVel = 2
dParamVel2 = 258
dParamFMax = 3
dParamFMax2 = 259
dParamFudgeFactor = 4
dParamBounce = 5
dParamCFM = 6
dParamStopERP = 7
dParamStopCFM = 8
dParamSuspensionERP = 9
dParamSuspensionCFM = 10
dContactMu2 = $001
dContactFDir1 = $002
dContactBounce = $004
dContactSoftERP = $008
dContactSoftCFM = $010
dContactMotion1 = $020
dContactMotion2 = $040
dContactSlip1 = $080
dContactSlip2 = $100
dContactApprox0 = $0000
dContactApprox1_1 = $1000
dContactApprox1_2 = $2000
dContactApprox1 = $3000
camera=CreateCamera(WindowID(),0)
PositionEntity(camera, 0, 10, -30)
img1=LoadTexture("tex3.jpg")
ScaleTexture(img1,20,20)
img2=LoadTexture("tex2.bmp")
cube1=CreateCube(0)
ScaleMesh(cube1,1000,0.5,1000)
PaintMesh(cube1,img1)
space=ODE_dWorldCreate(1)
ODE_dSetContactMode(dContactBounce + dContactSoftERP + dContactSoftCFM + dSlip1 + dSlip2)
ODE_dSetMU(0.6); Friction
ODE_dSetBOUNCE(0.5)
ODE_dSetSOFT_ERP(0.9)
ODE_dSetSOFT_CFM(0.1)
For i=1 To 10
gbody = ODE_dBodyCreate()
ggeom = ODE_dCreateBox(space, 2, 2, 2, 10)
gmesh = CreateCube(0)
PaintMesh(gmesh,img2)
ODE_dGeomSetBody(ggeom,gbody,gmesh)
ODE_dBodySetPosition(gbody,Random(30), Random(40), Random(30))
ODE_dBodySetRotation(gbody, Random(180), Random(180), Random(180))
Next
geom = ODE_dCreateBox(space, 15, 1, 15, 10)
ODE_dGeomSetPosition(geom, 0, 3, 0)
ODE_dGeomSetRotation(geom, -20, 0, 0)
mesh = CreateCube(0)
PaintMesh(mesh,img2)
PositionEntity(mesh, 0, 3, 0)
RotateEntity(mesh, -20, 0, 0)
ScaleMesh(mesh, 0.5, 0.5, 0.5)
ScaleEntity(mesh, 15, 1, 15)
ODE_UpdateGeoms()
MoveMouse(400,300)
XPos.f=WindowMouseX()
YPos.f=WindowMouseY()
yaw.f=-20
Repeat
EventID.l = WindowEvent()
If GetAsyncKeyState_(#VK_UP) <> 0
move.f=0.5
ElseIf GetAsyncKeyState_(#VK_DOWN) <> 0
move.f=-0.5
EndIf
If GetAsyncKeyState_(#VK_RIGHT) <> 0
strafe.f=0.4
ElseIf GetAsyncKeyState_(#VK_LEFT) <> 0
strafe.f=-0.4
EndIf
mx.f=curvevalue(-(WindowMouseX()-XPos)/10.0,mx,10)
my.f=curvevalue((WindowMouseY()-YPos)/10.0,my,10)
MoveMouse(400,300)
XPos.f=WindowMouseX()
YPos.f=WindowMouseY()
yaw.f=yaw+mx
pitch.f=pitch+my
If pitch>85 :pitch=85:EndIf
If pitch<-85 :pitch=-85:EndIf
RotateEntity(camera,0,yaw.f,0)
TurnEntity(camera,pitch.f,0,0)
MoveEntity(camera,strafe,0,move)
move=0
strafe=0
ODE_dWorldQuickStep(0.1)
ODE_UpdateGeoms()
RenderWorld()
Until EventID=#PB_EventCloseWindow Or GetAsyncKeyState_(#VK_ESCAPE)
End
Hmm, ok, i've lied, my 3d engine is nearly exactly the same syntax as blitz3d

But i still miss some commands, though i've nearly done a dirextX .x file importer and i'm doing a .3ds file importer too

But i plan to integrate ode in the engine, so i'm doing that at the moment
