Quote: "the sprite height still annoys me though."
While you have the virtual resolution set to 1280x720, the draw area won't fill the screen because of your phone's on screen buttons. You'll need to use SetScissor( ) to correct for this.
I've modified your code, this should work:
SetVirtualResolution( 1280,720 )
SetOrientationAllowed( 0,0,1,0 )
SetViewOffset(0.0,0.0)
SetPrintSize( 32 )
SetGlobal3DDepth(10000)
SetScissor( 0,0,0,0 )
Global screenWidth : screenWidth = Abs( GetScreenBoundsLeft( ) ) + GetScreenBoundsRight( )
Global screenHeight : screenHeight = Abs( GetScreenBoundsTop( ) ) + GetScreenBoundsBottom( )
//Camera(s)
LeftEyeX# = -5.0
LeftEyeY# = 0.0
LeftEyeZ# = 0.0
RightEyeX# = 5.0
RightEyeY# = 0.0
RightEyeZ# = 0.0
SetCameraPosition(1,0.0,0.0,0.0)
SetCameraFOV(1,90.0)
SetCameraRange(1,5,2000)
//images to render
LeftEyeImg = CreateRenderImage(screenWidth/2.0,screenHeight,0,0 )
LeftEyeSpt = CreateSprite(0)
SetSpriteTransparency( LeftEyeSpt,0 )
SetSpriteDepth(LeftEyeSpt,1)
FixSpriteToScreen(LeftEyeSpt,1)
RightEyeImg = CreateRenderImage(screenWidth/2.0,screenHeight,0,0 )
RightEyeSpt = CreateSprite(0)
SetSpriteTransparency( RightEyeSpt,0 )
SetSpriteDepth(RightEyeSpt,1)
FixSpriteToScreen(RightEyeSpt,1)
//objects
dim BoxID[6] as integer
BID = 0
BoxID[BID] = CreateObjectBox(25.0,25.0,25.0)
SetObjectColor(BoxID[BID],255,0,0,255)
SetObjectVisible(BoxID[BID],1)
SetObjectPosition(BoxID[BID],100,0,0)
BID = BID+1
BoxID[BID] = CreateObjectBox(25.0,25.0,25.0)
SetObjectColor(BoxID[BID],0,255,0,255)
SetObjectVisible(BoxID[BID],1)
SetObjectPosition(BoxID[BID],0,100,0)
BID = BID+1
BoxID[BID] = CreateObjectBox(25.0,25.0,25.0)
SetObjectColor(BoxID[BID],0,0,255,255)
SetObjectVisible(BoxID[BID],1)
SetObjectPosition(BoxID[BID],-100,0,0)
BID = BID+1
BoxID[BID] = CreateObjectBox(25.0,25.0,25.0)
SetObjectColor(BoxID[BID],255,255,0,255)
SetObjectVisible(BoxID[BID],1)
SetObjectPosition(BoxID[BID],0,-100,0)
BID = BID+1
BoxID[BID] = CreateObjectBox(25.0,25.0,25.0)
SetObjectColor(BoxID[BID],255,0,255,255)
SetObjectVisible(BoxID[BID],1)
SetObjectPosition(BoxID[BID],0,0,100)
BID = BID+1
BoxID[BID] = CreateObjectBox(25.0,25.0,25.0)
SetObjectColor(BoxID[BID],0,255,255,255)
SetObjectVisible(BoxID[BID],1)
SetObjectPosition(BoxID[BID],0,0,-100)
Do
//get the rotational vector
RotSensorX# = Sensor_GetRotVectorX()
RotSensorY# = Sensor_GetRotVectorY()
RotSensorZ# = Sensor_GetRotVectorZ()
//find the W part of the quaternion
RotW# = sqrt(1 - (RotSensorX#*RotSensorX#) - (RotSensorY#*RotSensorY#) - (RotSensorZ#*RotSensorZ#))
//set the camera rotation
SetCameraRotationquat(1,RotW#,RotSensorY#,-RotSensorX#,RotSensorZ#)
//quitting
if GetRawKeyPressed( 27 ) then end
Update(0)
//Left Eye
SetCameraPosition(1,LeftEyeX#,LeftEyeY#,LeftEyeZ#)
SetRenderToImage( LeftEyeImg,0 )
ClearScreen( )
Render( )
SetCameraPosition(1,RightEyeX#,RightEyeY#,RightEyeZ#)
SetRenderToImage( RightEyeImg,0 )
ClearScreen( )
Render( )
SetSpriteImage( LeftEyeSpt,LeftEyeImg)
SetSpriteSize( LeftEyeSpt,screenWidth/2.0,screenHeight )
SetSpritePosition( LeftEyeSpt,GetScreenBoundsLeft( ),0 )
SetSpriteVisible( LeftEyeSpt,1 )
SetSpriteImage( RightEyeSpt,RightEyeImg)
SetSpriteSize( RightEyeSpt,screenWidth/2.0,screenHeight )
SetSpritePosition( RightEyeSpt,GetScreenBoundsLeft( ) + screenWidth/2.0,0 )
SetSpriteVisible( RightEyeSpt,1 )
//x1# = worldtoscreenx(getspritex(RightEyeSpt))
//y1# = worldtoscreeny(getspritey(RightEyeSpt))
//x2# = x1#
//y2# = y1# + worldtoscreeny(getspriteheight(RightEyeSpt))
SetRenderToScreen( )
drawline(GetScreenBoundsLeft( ) + ( screenWidth / 2.0 ),GetScreenBoundsTop( ),GetScreenBoundsLeft( ) + ( screenWidth / 2.0 ),GetScreenBoundsBottom( ),255,255,255)
for BID=0 to 5
SetObjectVisible(BoxID[BID],0)
next BID
Render( )
Swap( )
SetSpriteVisible( LeftEyeSpt,0 )
SetSpriteVisible( RightEyeSpt,0 )
for BID=0 to 5
SetObjectVisible(BoxID[BID],1)
next BID
Loop
Function Sensor_GetGyroExists( )
e = 0
if GetMemblockExists( 1 )
e = GetMemblockInt( 1,0 )
endif
Endfunction e
Function Sensor_GetGyroX( )
x# = 0
if GetMemblockExists( 1 )
x# = GetMemblockFloat( 1,4 )
endif
Endfunction x#
Function Sensor_GetGyroY( )
y# = 0
if GetMemblockExists( 1 )
y# = GetMemblockFloat( 1,8 )
endif
Endfunction y#
Function Sensor_GetGyroZ( )
z# = 0
if GetMemblockExists( 1 )
z# = GetMemblockFloat( 1,12 )
endif
Endfunction z#
Function Sensor_GetProximityExists( )
e = 0
if GetMemblockExists( 1 )
e = GetMemblockInt( 1,16 )
endif
Endfunction e
Function Sensor_GetProximity( )
p# = 0
if GetMemblockExists( 1 )
p# = GetMemblockFloat( 1,20 )
endif
Endfunction p#
Function Sensor_GetLightExists( )
e = 0
if GetMemblockExists( 1 )
e = GetMemblockInt( 1,24 )
endif
Endfunction e
Function Sensor_GetLight( )
l# = 0
if GetMemblockExists( 1 )
l# = GetMemblockFloat( 1,28 )
endif
Endfunction l#
Function Sensor_GetMagneticExists( )
e = 0
if GetMemblockExists( 1 )
e = GetMemblockInt( 1,32 )
endif
Endfunction e
Function Sensor_GetMagneticX( )
x# = 0
if GetMemblockExists( 1 )
x# = GetMemblockFloat( 1,36 )
endif
Endfunction x#
Function Sensor_GetMagneticY( )
y# = 0
if GetMemblockExists( 1 )
y# = GetMemblockFloat( 1,40 )
endif
Endfunction y#
Function Sensor_GetMagneticZ( )
z# = 0
if GetMemblockExists( 1 )
z# = GetMemblockFloat( 1,44 )
endif
Endfunction z#
Function Sensor_GetRotVectorExists( )
e = 0
if GetMemblockExists( 1 )
e = GetMemblockInt( 1,48 )
endif
Endfunction e
Function Sensor_GetRotVectorX( )
x# = 0
if GetMemblockExists( 1 )
x# = GetMemblockFloat( 1,52 )
endif
Endfunction x#
Function Sensor_GetRotVectorY( )
y# = 0
if GetMemblockExists( 1 )
y# = GetMemblockFloat( 1,56 )
endif
Endfunction y#
Function Sensor_GetRotVectorZ( )
z# = 0
if GetMemblockExists( 1 )
z# = GetMemblockFloat( 1,60 )
endif
Endfunction z#
Quote: " I've also managed to get hold of some lenses which I should be getting on Friday so next weekend will be the ultimate test for this."
I built my Cardboard yesterday, however the lenses won't get here until Thursday.
Sean