[Closed] Mathew3D.com releases Rotation scripts.
here everything works as expected – alt least the rolling sphere stuff.
max9 + mzp is a book with seven seals – as they seem to have forgoten to add all these new directory stuff into the mzp …
but don’t get your thread haijacked by such base motives
cool setup.
I might to add the rolling cube preset ?
Georg
I’m glad you guys got it working.
The MZP is not up to date with the changes with Max 9, but if they updated it then the MZP wouldn’t work on older versions of Max. What I wish they would add is the ability to create custom toolbars, menus and quads inside the mzp.run file. A clean and simple way.
Things aren’t that well setup for users in Max 9. They have user macros, but no user stdscripts folder. I would have to put files in the startup folder, but I don’t know if that’s the correct place for defining global functions.
Anyway, don’t get me started on MZP. :shrug:
In the future -> I have a couple of other rotation scripts that I will include in the next release. There is “Gears”, “Spin”, “Pendulum” and “Tick Tock”. Nothing to special except they make simple rotation animations quickly.
Yes, Yes, Yes, Yes, -> Don´t work
then restart 3dsmax8 -> Don´t work
but: Since a windows restart the Script functions problem-free. And I LOVE IT. Great Work Mathew. I will use it al lot.
Hi Mustan9,
May be there is an error in Version 1.0: M3D_Rotations
When you calculte the radius with:
[size=3][font=Times New Roman][color=white] box = obj.max – obj.min[/color][/font][/size]
r = if box.x > box.y then box.x else box.y
r = if box.z > r then box.z else r
What happend when the object is rotated along the direction of movement?
The bounding box is calculated in world space, and the result will be bigger than the real radius.
Suppose the object is rotated 45 degrees, then the simple radius will be (1 / cos 45) bigger than the real one. Am I right?
Sory about this but I’m looking for a way to calculate it exactly.
I guess there is another potential error.
If the mesh was a collapsed cylinder with a few sides, the bounding box will be smaller than the real radius.
Thank you for the script. I’m learning a lot with it.
Fernando
Yes, that is a bug.
It should have been this.
in coordsys local
(
box = obj.max - obj.min
r = if box.x > box.y then box.x else box.y
r = if box.z > r then box.z else r
)
I’m not sure that will adjust for scaling?
At the time I wrote the tool I always created a proxy object as a wheel or ball. Like a simple sphere or something, and then ran the script on that object. Then I would just parent the real geometry of the ball to that proxy object.
The reason I look up the radius from the object, and not as a custom attribute on the controller. Is that you can animate the radius of the object, and the script controller will still calculate the correct rotation. If I make it a custom attribute, then when you change the radius the sphere won’t resize.
I guess there is another potential error.
If the mesh was a collapsed cylinder with a few sides, the bounding box will be smaller than the real radius.
I don’t know, because it depends on what axis the cylinder was rotating on? If it was really long cylinder but had a thin radius, then the calculated radius would be wrong. Because the script assumes the longest edge of the box is the radius.
But you right, the bounding box of a low-polygon object may not be correct.
It would be best to create an object (disable rendable) that has a radius parameter and place the controller on that object, then parent your renderable geometry to that object.
Hi Mustan9,
Thanks for your answer.
I know this is not a big issue at your script, but I insist trying to correct mine.
I draw a cylinder with a radius of 50.0 units and rotate it 45 degrees.
This code returns 99.2404 instead of 50.
in coordsys local (
bbox = $.max – $.min
r = if bbox.x > bbox.y then bbox.x else bbox.y
r = if bbox.z > r then bbox.z else r
r/2.0
)
The bounding box is calculated considering the 45 degrees and the distance between .max and .min bigger.
You are right with the other point. As your code takes the longest distance, the result is the real radius of a cylinder, without concerning how many sides it has.
Fernando
Hi Fernando,
I’m puzzled. :shrug:
The min/max values should not be changing when the object is rotated, and you read them in object space. The only thing I can think of is that those values are calculated in world space, and then translated into object space. Which would cause them to change.
What is strange is that the min/max values shown in the object’s properties dialog don’t change when rotated.
I’ll continue to look into this. I think the solution is to get the bounding box from the TriMesh of the object, but I can’t find the method in MaxScript.
Hi Mustan9,
I’ve been doing some tests with the bounding box of a cylinder in local space.
If I copy de position from .max and .min in local space to some point helpers with:
in coordsys $Cylinder01 ($Point01.pos = $Cylinder01.max; $Point02.pos = $Cylinder01.min)
they appear at the corners of a box BOUNDING the rotated bounding box of the cylinder. 😮
Fernando
Hi guys,
Just to let you know. I’ve started on an update for this script pack. The next release will include a Tracks controller for the rotation of tank tracks, and rotation of chains.
I’m still in the process of figuring out what features this should have. So if anyone has any ideas let me know.
Thanks,