Hi,
I'm a bit confused here...
The Manual says:
"SetCameraPosition(cameraID, x, y, z ) By default cameras are positioned at 0,0,0. "
"SetCameraRotation(cameraID, angx, angy, angz) By default cameras are created with the angles 0,0,0 in the order YXZ"
But the short piece of code below reports:
camx=0, camy= 10, camz= -20, camangleX= 26.565050 , so not (0,0,0) and angle 0.
objectx,y,z are correct, but objectangleX= -0.000, which is odd?
So not at all that default.
Of course if I change these values to the default ones in the manual then the object is of course no longer in view, which sort of makes more sense.
Could this be a residu of debugging by the AppGameKit development team or is this intentional?
// Project: 3D camera position test (bug??)
// Created: 2017-08-31
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "3D camera position test" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
global playerBoxID, bodyID, headID, feetID, leftArmID, rightArmID, gunID
global playerheight#, playerwidth#, playerthickness#
playerheight#=1.8
playerwidth#=.7
playerthickness#=.5
playerBoxID=CreateObjectBox(playerwidth#,playerheight#,playerthickness#)
SetObjectColor(playerBoxID,255,255,0,100) //
SetObjectTransparency(playerBoxID, 1)
SetObjectPosition(playerBoxID, 0, 0, 0)
SetObjectRotation(playerBoxID, 0,90,0)
// Manual says:
// SetCameraPosition(cameraID, x, y, z ) "By default cameras are positioned at 0,0,0. "
// SetCameraRotation(cameraID, angx, angy, angz) "By default cameras are created with the angles 0,0,0 in the order YXZ"
// but this program reports:
// camx=0, camy= 10, camz= -20, camangleX= 26.565050 , so not (0,0,0) and angle 0.
// objectx,y,z are correct, but objectangleX= -0.000, which is odd?
// If I change these values to the default ones in the manual then the object is of course no longer in view,
// which sort of makes sense.
// Experimentation:
// SetCameraPosition(1,0,0,0) : SetCameraRotation(1,0,0,0)
// SetObjectPosition(playerBoxID, 0, 0, 0) : SetObjectRotation(playerBoxID, 0,90,0)
//SetCameraPosition(1,0,20,-20)
// SetCameraRotation (1,0,0,0) : SetCameraLookAt(1, GetobjectX(playerBoxID),GetobjectY(playerBoxID),GetObjectZ(playerBoxID),0)
do
print ("camx= " + str(getcamerax(1)) +" , camy= "+ str(getcameray(1)) +" , camz= " +str(getcameraz(1)))
print ("objectx= " + str(getobjectx(playerBoxID)) +" , objecty= "+ str(getobjecty(playerBoxID)) +" , objectz= " +str(getobjectz(playerBoxID)))
Print("")
print ( "camXangle= " + str(GetCameraAngleX(1)) + " , camYangle= " + str(GetCameraAngleY(1)) +" , camZangle= " + str(GetCameraAngleZ(1)))
print ( "objectXangle= " + str(GetObjectAngleX(playerBoxID)) + " , objectYangle= " + str(GetObjectAngleY(playerBoxID)) +" , objectZangle= " + str(GetObjectAngleZ(playerBoxID)))
//Print( ScreenFPS() )
Sync()
loop
Can anybody confirm this is a bug or intentional?
Kind regards & thanks,
Rick Nasher