- This topic has 10 replies, 3 voices, and was last updated 5 years, 1 month ago by GLiFTeK.
-
AuthorPosts
-
2019-09-29 at 1:13 pm #19454GLiFTeKCustomer
Hi
I’m using the “Drag Rotate” puzzle.
It’s a sphere that’s being dragged to rotate.
i have the rotatoinal values printed in console.during a full rotation…they go from -0 to -90 then -90 back to -0 then 0 to 90 and then 90 back down to 0.
I was suprised to see that.. but after awhile it made kind of sense as the perspective i’m dragging from kind of follows that pattern.
I need the values to be read straight from 0 to 360 in order to do some other important things.
any advice with this?Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2019-09-30 at 5:58 am #19473Yuri KovelenovStaff2019-09-30 at 9:06 am #19508GLiFTeKCustomerHi,
We should have fixed this issue in 2.15 pre3. Can you check it out?it’s now doing ..”half” of that? .. i’m thinking?
goes to 180. then begins AT -180 and descends…
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2019-09-30 at 9:17 am #19514Yuri KovelenovStaffYeah, it was another issue that was fixed. This behavior is considered normal, because 180 and -180 angles represent the same rotation.
I need the values to be read straight from 0 to 360 in order to do some other important things.
any advice with this?You can possibly check the values and if they get negative, just add 360.
2019-09-30 at 10:15 am #19536GLiFTeKCustomerYeah, it was another issue that was fixed. This behavior is considered normal, because 180 and -180 angles represent the same rotation.
I need the values to be read straight from 0 to 360 in order to do some other important things. any advice with this?
You can possibly check the values and if they get negative, just add 360.
like this right?
… same behavior results though.Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2019-09-30 at 10:31 am #19542Yuri KovelenovStaff2019-09-30 at 12:23 pm #19547GLiFTeKCustomerso it’s basically absoluting it /mod % to switch it up ..
Verifying formula that will convert longitude 0-360 to -180 to 180?they put forth:
“To convert longitude from (-180 to 180) to (0-360)
Matlab lon3=mod(lon1,360)
Fortran lon3=modulo(lon1,360)
”but after more searching i found this .. and it’s always talked about as link -“atan2” ..
some serious work on it here to…
“To get the global Y rotation (rotation around the world Y axis) is pretty straightforward. It’s just an atan2 of the forward vector:”var _transformedForward = new pc.Vec3(); pc.util.getYaw = function (quat) { var transformedForward = _transformedForward; quat.transformVector(pc.Vec3.FORWARD, transformedForward); return Math.atan2(-transformedForward.x, -transformedForward.z) * pc.math.RAD_TO_DEG; };
– [SOLVED] Getting Y rotation as 0 – 360 degrees (or -180 to 180)
damn can’t this be done simply?
like.. with .. creative parenting/tracking/constraints? or something?
in waaaay over my head…Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2019-09-30 at 12:24 pm #19548GLiFTeKCustomervar _transformedForward = new pc.Vec3(); pc.util.getYaw = function (quat) { var transformedForward = _transformedForward; quat.transformVector(pc.Vec3.FORWARD, transformedForward); return Math.atan2(-transformedForward.x, -transformedForward.z) * pc.math.RAD_TO_DEG; };
– [SOLVED] Getting Y rotation as 0 – 360 degrees (or -180 to 180)
in way over my head.
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2019-09-30 at 12:32 pm #19549GLiFTeKCustomeri don’t know if this is even necessary.
all i’m trying to do is have a clean “ease-out” to the drag movement of scrollable menu items in a carousel menu. like the ol’ ipad menues.. etc..i can drag stuff.. but they stop.. the “drop:do” is where i’m adding an animate param over time” puzzle.. to try to take it’s “dropped” value and tween it to the nearest 6th.. (60deg’s woth of the carousel…)
thought knowing where it was when it was around 0-360 would help in solving this.
but i have to move on to other aesthetic areas now..
maybe i’ll find a diff solution for this.
stufff’s way too complex for my caveman artist brain.
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2019-09-30 at 1:12 pm #19553Ivan LyubovnikovStaffHi GlifTek, the “get rotation” puzzle always returns rotation angles converted into the range [-180, 180]. But you should be able to convert them to [0, 360] with the following function
You can just use the values returned from this function the same way as those that are in the range [-180, 180], they have the same effect when you apply them to an object.
Attachments:
You must be logged in to view attached files.Co-founder and lead developer at Soft8Soft.
2019-10-02 at 9:35 am #19721GLiFTeKCustomerHi GlifTek, the “get rotation” puzzle always returns rotation angles converted into the range [-180, 180]. But you should be able to convert them to [0, 360] with the following function
You can just use the values returned from this function the same way as those that are in the range [-180, 180], they have the same effect when you apply them to an object.fantastic! thanks so much!
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature! -
AuthorPosts
- You must be logged in to reply to this topic.