Sorry its a little late Ivan but here you go.
Cheers,
Ian
// Small example.
GLOBAL md2%
GLOBAL camera%, light%, font%, tex2%, tex3%, floor%
GLOBAL player_type%=1
GLOBAL scene_type%=2
DIM z%[1]
// we need TO see things AND be able TO move around IN the world
xGraphics3D(1)
font = xLoadFont("Media/Tahoma22")
tex2 = xLoadTexture("Media/wall.jpg",FLAGS_MIPMAPPED%)
tex3 = xLoadTexture("Media/model/dragon.bmp",FLAGS_MIPMAPPED%)
md2% = xLoadAnimMesh("Media/model/dragon.md2", 0)
// Set the font
xSetFont(font)
// create the ground
floor=xCreateCube(0)
xScaleEntity(floor,50,1,50,0)
xPositionEntity(floor,50,-4,50,0)
xEntityColor(floor,255,255,255)
xScaleTexture(tex2,10,10)
xEntityTexture(floor,tex2,0,0)
xEntityType(floor,scene_type,FALSE)
// create player POV
camera%=xCreateCamera(0)
xPositionEntity(camera%,80,80,80,0)
xCameraRange(camera%,.1,500)
xEntityRadius(camera%,2,5)
xEntityType(camera%,player_type,FALSE)
xCameraClsMode( camera, FALSE, TRUE )
// Turn on Tilt
xEnableAccelerometer(TRUE)
// TO make things a wee bit brighter, though we can use AmbientLight, AS well
light%=xCreateLight(0,0)
// set up our collisions
xCollisions(player_type,scene_type,2,2)
// Setup MD2
xEntityTexture(md2,tex3,0,0)
xAnimate(md2%,ANIMATION_LOOP%,1,0,1)
xScaleEntity(md2%,0.5,0.5,0.5,0)
xPositionEntity(md2%,50,10,50,0)
WHILE 1=1
xClsColor( ABS(SIN(GETTIMERALL()/100))*255, ABS(SIN(GETTIMERALL()/300))*255, ABS(SIN(GETTIMERALL()/600))*255 )
xCls()
xTranslateEntity(camera%,0,-1,0) // a little bit of gravity FOR us
// Tilt move
IF xGravitationY() > -0.20 THEN xMoveEntity(camera,0,0,-.2,0)
IF xGravitationY() < -0.40 THEN xMoveEntity(camera,0,0,0.1,0)
IF xGravitationX() < -0.20 THEN xTurnEntity(camera,0,1,0,0)
IF xGravitationX() > 0.20 THEN xTurnEntity(camera,0,-1,0,0)
// xTurnEntity(camera,0,xTouchX(0)-xTouchPrevX(0),0,0) // Touch turn?
xUpdateWorld(1)
xRenderWorld()
xText(0,0,"FPS:"+xFPSCounter(),FALSE,FALSE)
xFlip()
WEND
[attachment deleted by admin]