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 / How to adjust vertex position based off rotation for memblocks?

Author
Message
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 24th Aug 2019 21:32
Say I have an object that needs to be rotated SetObjectRotation(ID, 90, 25, 180).

How can I adjust the objects vertices in a memblock to reflect these changes?

I am combining multiple objects into one mesh, so rotating the final mesh won't work.

Thanks for any help!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 24th Aug 2019 23:40
So create the object as stand alone at 0/0/0 (When you first create the mesh)
Then rotate that separate object, record the change in x/y/z of each vertex
Then apply the change to each vertex in the mesh
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 25th Aug 2019 00:26 Edited at: 25th Aug 2019 00:57
Right, but I don't know how to apply the change. No idea how to rotate the vertices correctly, or "record the change per vertex." Only the original vertex position is recorded in the memblock, AFAIK. Unless, there is a command that will set the rotation permanently, like we can do with setobjectscalepermanent(). I am not aware of one.

Maybe I am misunderstanding?


FixObjectPivot() works like SetObjectScalePermanent() except for Rot & Pos instead of scale.

Thanks, Blink0k. I wouldn't have thought to look for that.

Login to post a reply

Server time is: 2024-10-01 10:19:34
Your offset time is: 2024-10-01 10:19:34