Hello
I try to load a simple obj file, but it's not working.
I use this code (there is a function added to zoom in and out or to pan the camera, incase the object would be large or anything like that)
CreateObjectBox(1, 1, 1, 1)
SetObjectPosition(1, 2, 0, 0)
LoadObject(2, "man.obj")
SetObjectColor(2, 200, 0, 0, 0)
Global startX As Float
Global startY As Float
Global angleX As Float
Global angleY As Float
do
ProcessMouse()
sync()
loop
Function ProcessMouse()
//Scrolling
MoveCameraLocalZ(1, -GetRawMouseWheelDelta())
//Panning camera
If GetRawMouseRightPressed()
startX = GetPointerX()
startY = GetPointerY()
angleX = GetCameraAngleX(1)
angleY = GetCameraAngleY(1)
EndIf
diffX As Float
diffY As Float
newX As Float
If GetRawMouseRightState() = 1
diffX = (GetPointerX() - startX)
diffY = (GetPointerY() - startY)
newX = angleX + diffY
if ( newX > 89 ) then newX = 89
if ( newX < -89 ) then newX = -89
SetCameraRotation( 1, newX, angleY + diffX, 0 )
EndIf
EndFunction
The object man.obj is added as attachement.
Am I doing something wrong? Or is there something wrong with the importer?
Thanks