Well, I tried a couple of methods, like, Global or Local but non seems to work.
I rotated the character and fixed it's pivot, and it worked, but, after that, at some point we need to rotate the character in space left or right, sadly, when I try to rotate it facing the camera, it breaks down as shown in the first picture.
This is the whole code:
// Project: bonetest
// Created: 2019-09-22
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "bonetest" )
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( 60, 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
LoadObjectWithChildren(1, "soldier.X")
RotateObjectLocalY(1, 180)
FixObjectPivot(1)
SetObjectPosition(1, 0, -75, 100)
RotateObjectLocalY(1, 180)
do
SetObjectBoneLookAt(1, 8, -getcamerax(1), -getcameray(1), -getcameraz(1), 0)
if GetRawKeyState(32) = 1
MoveCameraLocalY(1, 1)
endif
if GetRawKeyState(13) = 1
MoveCameraLocalX(1, 1)
endif
if GetRawKeyState(19) = 1
MoveCameraLocalX(1, -1)
endif
for bns = 1 to 30
print(GetObjectBoneName(1, bns))
next bns
Print( ScreenFPS() )
Sync()
loop
I can try to upload the soldier.X but I don't know if I am allowed, since it's TGC's object.
www.alexmatei.com