HI, I am having problem with cameraproject() and projectX(),projectY(). I wanted to keep the mouse pointing to the entity selected. Simply using "movemouse projectedX(),projectedY()" does not work. I don't know what I am doing wrong, because the following code works in blitz3d but not in minib3d. The returned value seems wrong (I think). The projectY() and projectx() are not returning the equivalent 2d position. Maybe someone could tell me what I am doing wrong. I would apreciate any help. This code ilustrate the problem, the mouse pointer moves in a different direction than the entity:
Import sidesign.minib3d
Strict
Graphics3D 640,480,0,2
Local cam:TCamera=CreateCamera()
PositionEntity cam,0,2,-10
Local light:TLight=CreateLight(1)
Local cube1:TMesh=CreateCube()
EntityPickMode cube1,2
PositionEntity cube1,-6,0,0
While Not KeyDown(KEY_ESCAPE)
MoveEntity cube1,0.01,0.005,0.005
CameraProject cam,EntityX(cube1,1),EntityY(cube1,1),EntityZ(cube1,1)
MoveMouse ProjectedX#(),ProjectedY#()
RenderWorld
text 10,10,ProjectedX()
text 10,30,ProjectedY()
Flip
Wend
End
|