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 / FixObjectPivot explanation

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd Jan 2016 10:07
After running FixObjectPivot on an object, it's position is reported as 0,0,0
For example, an object is positioned at 3,3,3. Checking the position, 3,3,3 is reported.
After FixObjectPivot, position is reported as 0,0,0 although visually it is in same place.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 2nd Jan 2016 17:11
From the docs:
Quote: "Resets the object's position and rotation to 0 whilst keeping the object's vertices where they are."


So reading that, I'd expect the position to report as 0,0,0 even though the vertices remain where they are in the 3d world. What is the bug?

I guess this is a bit like a setspriteoffset, only for 3d objects right?


V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 2nd Jan 2016 21:11 Edited at: 2nd Jan 2016 21:52
Try rotating the object, with the pivot point at 0,0,0 and the vertices centered around 3,3,3. You will see the difference.

EDIT: here's code to demonstrate...



By adjusting the object's world position before you fix its pivot point, you can make the object's "center" be virtually anywhere.

For instance, your arm doesn't pivot at its center, it pivots at your shoulder. And your forearm pivots at your elbow, etc.

MORE EDIT: I'm going to submit this to the help file. I've changed the example up a bit, so if you're not seeing the image below, copy it again

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Jan 2016 18:33
It needed your explanations to make this clear.
I understood it as the obect's local 0,0,0, not the global 0,0,0.
I was using the above code as a workaround, without realising it was the correct way to use the command.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Login to post a reply

Server time is: 2024-09-29 09:17:59
Your offset time is: 2024-09-29 09:17:59