Can anyone show me a method to rotate an object along Y axis without the flip problem ?
In other words:
i want use TransformSet statement within a loop to rotate an object from 0 to 360 degree…
Thank you
cameyo
Can anyone show me a method to rotate an object along Y axis without the flip problem ?
In other words:
i want use TransformSet statement within a loop to rotate an object from 0 to 360 degree…
Thank you
cameyo
Hi, Cameyo.
Pixolator posted a solution to a similar problem I was having in this thread:
http://www.pixolator.com/zbc-bin/ultimatebb.cgi?ubb=get_topic&f=1&t=006172
Maybe this will help?
Thank you WingedOne…i’ll try it tonight.
But i hope Pixolator (or other) will post the complete code to do this.
Thank you
cameyo
This is how I rendered spins a few days after I got ZB2- not sure what the flip-problem was, (I’m certainly not a programer, so this is stupidly simple minded, but did what I wanted). Will this generate the flip-problem?
[IButton, “Spin”, “Render a turntable”,
[varset, isframeone, 1]
[Loop, 60,
[IShowActions, 0]
[ISet, Tool: Deformation: rotate, 6]
[IPress, Render: Best]
[IPress, document: exportimage]
[if, isframe == 1,
[varset, name, [FileNameGetLastTyped]]
]
[varset, #name, [FileNameAdvance, #name, 2]]
[FileNameSetNext, #name]
[varinc, isframeone]
]
,0]
An only vaguely related thing- I’m curious if we have everything there is to know about the new ZScript stuff in the Cmd button, or if there is more coming?
More is coming after the release of the Mac version.
RobW,
Have a look here for the QuickLinks concerning ZScripting and sample ZScripts from previous versions of ZBrush…
Existing QuickLink ZScript References
In another thread Aurick promises new info for ZScripters concerning new scripting commands and methods for creating and incorporating ZScript plug-ins for the new release. BTW, you can print out a complete(?) lexicon of ZScript commands by pressing the ZSCRIPT:EXPORT COMMANDS button (in case you haven’t found that yet.)
According to my own experience with this problem, here’s how I understand it:
First off, your script does something different from what Cameyo wants to do.
He wants to use the TransformSet command which APPLIES a Transform calculation without disturbing the object’s current HOME position. The resulting problem is that as he applies a Transform/Rotation about the Y axis that goes past plus or minus 90 degrees, there is a calculation interaction with the transformations of the other two axes that can cause a “binding or gimble-lock” result. The rotational calculations between the Y axis rotation and those of the other two axes can tend to cancel each out or force an odd, 180 degree flip of the object.
What you are doing in YOUR own sample code is changing the ACTUAL home position of the object (each step of the loop by 6 degrees)… so the resulting new view you save has become the new default home position for the object - consequently, there is no accumulated Y axis rotational transform offset - which is good… except you’ve permanently lost the original orientation for the object (if you interrupt the loop) especially for any future operations you might want to do on the object… like accurate, symmetrical modeling along some axis, for instance.
In Pixolator’s special case “fix”, I think he just checks if the Y axis calculated rotation transformation goes beyond -90 or +90 degrees, and adjusts another axis offset value by 180 degrees (on the fly) to avoid the Gimble Lock calculation problem.
One Caution: I don’t really understand much about the inner workings of the geometry here, so my pedestrian explanation is strictly intuitive… from an artist’s POV.
The heavy-hitter ZScripters like Digits and TVeyes and Cameyo and Muvlo and Pixolator can explain this with a lot more authority than I ever could.
Anyway, I hope this helps.
Sven
Aurick- excellent, thanks
Svengali- no way, that’s pretty
clear actually. Hadn’t gone into it any further because my models spun around and rendered out, which is all the excitement I wanted from that. Appreciate you taking the time to spell out that it’s a gimbol lock issue and what a possible solution is. Cameyo be sure to let us know what you settle on.
Hi all.
Sven you right about my problem (exact explanation)…and you are a big scripter too.
I think there are some other values in addition at 90 degree problem… I wish only know how to override these values. Is it too much?
I don’t think i need new script commands or new info to do this
.
Thank you all.
cameyo
PLEASE PIXOLATOR…help me with this annoying problem…
Thank you
cameyo
Hi Cameyo,
I am trying to get a working solution myself but have not had time to look into the problem. Maybe this thread can help you? Davey, I need your big brain, I am flippin out!
Thank you TVeyes,
but seems the problem is not solved…
Digit can’t rotate the head (at the end of the thread you point out).
I need a generic routine to rotate along Y axis with any X,Z rotate value.
In this weekend i have working on this problem and i have learned something more…maybe i can solve it in the next days.
cameyo