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 Classic Chat / Rotate an object about an offset?

Author
Message
Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 16th Aug 2017 13:02
I would like to rotate an object, plane or thin box, like a door opening.
When i use RotateObjectGlobalY(objno,angle# ) it rotates about its centre so clearly i need to somehow rotate about an offset so it rotates about its edge.

I suppose i could make the object twice the size and have half transparent but as a last resort.

Any pointers?
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 16th Aug 2017 13:37 Edited at: 16th Aug 2017 13:41
initially, Move your door on X axis like this : newX = currentX + DoorWidth/2 (With Global commands) to have the pivot in X=0 then apply the FixObjectPivot(objID) command to it, and then, try to rotate it ? (never used it but ... it should work)

Documentation and example : https://www.appgamekit.com/documentation/Reference/3D/FixObjectPivot.htm
--------------------------------
Join us on dedicated AppGameKit WeeKChat :
https://week.chat/room/AppGameKit
Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 16th Aug 2017 14:10
Hi Mike, spot on, just what i needed. I have played with the example and it does exactly what i want.

I still use the online F1 help file which annoyingly still doesn't show examples but still i might not have found this, so a big thanks.
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 16th Aug 2017 14:13
you're welcome !
--------------------------------
Join us on dedicated AppGameKit WeeKChat :
https://week.chat/room/AppGameKit

Login to post a reply

Server time is: 2024-04-20 00:48:42
Your offset time is: 2024-04-20 00:48:42