# 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.

### Newcomers AppGameKit Corner / Rotation about on an Arbitrary Axis in 3D?

Message
Posted: 28th Apr 2016 20:17
Hello! Is there a command for Arbitrary Axis Rotation or some way to do it? Thanks in advance.
Posted: 29th Apr 2016 07:55
Somebody could tell you the right way to do it with maths.
But I often cheat. Connect 2 objects together with a fixed joint. Rotate the central one and get the coordinates of the other.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Posted: 29th Apr 2016 09:44
You could setspriteoffset() and then setspriteangle() to set the rotation
Posted: 29th Apr 2016 09:50
Remember those local axis movements on 3D objects. Like, if you position an object where you need the centre of rotation to be, then rotate it, and move it for the local X Y Z, you can do it with fairly minimalist commands. Considering the maths involved verses just position, rotate, offset - it's a no brainer for me. You can of course position an object with another object, with local X Y Z offsets - like putting a plain at a specific location on a model and then billboarding it to face the camera, like a light effect or something.

The MoveObjectLocalX, Y, and Z commands are very, very useful.
Posted: 29th Apr 2016 11:16
Wow ! Thanks for all your help and such quick replies!
Posted: 2nd May 2016 16:55
Here is a code snippet from the help files, should do what you need.

The coffee is lovely dark and deep,and I have code to write before I sleep.