I am using an object and image from the example "3D-FirstPersonExample" in the code below, yet the object does not appear.
SetWindowTitle( "3d testing" )
setvirtualresolution(1280,720)
clearlightdirectionals()
SetWindowTitle( "3d testing" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
aButton1=1
aButton2=2
aButton3=3
aLight1=1
aCam1=1
LoadShader(1,"vertex.vs","pixel.ps")
clearlightdirectionals()
CreateLightDirectional( 1, 0, 0, 0, 255,255,255 )
SetLightDirectionalDirection( 1, -25, -50,-25 )
aObj1= LoadObject( "mesh1.obj" )
teximg=LoadImage("mesh1-1.jpg")
SetImageWrapU(teximg,1)
SetImageWrapV(teximg,1)
SetObjectImage(aObj1,teximg,0)
SetObjectScale(aObj1,1,1,1)
setobjectposition(aObj1,0,0,0)
setobjectlightmode(aObj1,1)
//setobjectcolor(aObj1,255,0,255,255)
SetObjectShader( aObj1, 0 )
//CreateLightPoint( aLight1, 0, 200,400 , 20, 255, 255, 255 )
SetCameraPosition(aCam1,0,0,-500)
SetCameraRotation(aCam1,0,0,0)
setcameralookat(aCam1,0,0,0,0)
AddVirtualButton(aButton1,100,500,50)
AddVirtualButton(aButton2,100,560,50)
AddVirtualButton(aButton3,100,620,50)
AddVirtualJoystick(1,100,100,100)
WHILE GetPointerPressed()=0
//Sync ( )
a=a+(GetVirtualJoystickX(1))
b=b+(GetVirtualJoystickY(1))
if GetVirtualJoystickY(1)>0.5 then MovecameraLocalZ(aCam1,-2.5)
if GetVirtualJoystickY(1)<-0.5 then MovecameraLocalZ(aCam1,2.5)
if GetVirtualJoystickX(1)>0.5
RotateCameraLocalY(1,0.8)
yrot=yrot+1.7
endif
if GetVirtualJoystickX(1)< -0.5
RotateCameraLocalY(1,-0.8)
yrot=yrot-1.7
endif
SetCameraPosition(aCam1,GetCameraX(1),100,GetCameraZ(1))
if GetVirtualButtonState(aButton2)=1 and aer > -93
aer = aer - 0.8
RotateCameraLocalX(1,-0.8)
turning=0
endif
if GetVirtualButtonState(aButton3)=1 and aer < 49
aer = aer + 0.8
RotateCameraLocalX(1,0.8)
turning=0
endif
sync()
ENDWHILE
END
Setting the SetObjectShader to 1 still shows nothing.
home.wavecable.com/~mindsclay