Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / showing axis in a 3D view

Author
Message
IanDunn
3
Years of Service
User Offline
Joined: 16th Dec 2020
Location: Reading, UK.
Posted: 17th Feb 2021 19:46
Hi, I think I already know the answer to this, but will ask it anyway

Is there anyway to show the current X,Y,Z axis when playing the game based on current camera view in 3D view ? If not, would be a useful display function to add - useful for debugging purposes.

Thanks
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 17th Feb 2021 20:02
Yes... and no.
There is no built-in Visualisation of the Data., but it's quite easy to model the axis (say in Blender or such); then essentially load it in at the X/Y/Z Position and Rotation... once you've done that use the "FixObjectToObject( Child, Parent)" to then not have to update anything else; the Engine will pretty much handle updating the Position and Rotation.

If you the SetObjectDepthWrite( Object, 7 ) this will ALWAYS Draw the Object... of course another approach is to hide it, and render it to another RenderImage; As once you're not longer rendering to it, you can use that on a Sprite (with a Transparency Key) and you have complete control over the depth of Sprites ... although I think the 7 Setting just ignores Depth and always renders the object on top.
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 18th Feb 2021 08:47
Hi, maybe you are looking for this...

Print( "Xangle "+str(GetCameraAngleX(cam1))+" Yangle "+str(GetCameraAngleY(cam1))+" Zangle "+str(GetCameraAngleZ(cam1)))

Y rotation is displayed 0 to 360, Z and X are not and that can be a bit of a pain sometimes.

Here is a little demo code....

BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.

Login to post a reply

Server time is: 2024-03-28 09:38:35
Your offset time is: 2024-03-28 09:38:35