Notifications
Clear all

[Closed] 50% rotational align

Hi,

I did a search on align inside the forum, but I couldn’t find a solution to my particular problem.

Does anyone know if there is a quick way of doing a partial align, like if I wanted to rotate an object halfway towards another one? I can’t seem to find anything that helps me in the maxscript documentation, and unfortunately I don’t know matrices and that complex stuff

I even tried

$Cylinder02.rotation = 0.5 * $Cylinder01.rotation

But I guess that was quite desparate

Thanks,
Rune

5 Replies

Hey Rune Spaans?!

I am a big fan of your work. Unfortunately your website doesn’t show up nowadays?

It’s quite interesting though. I was showing the stylized hellboy animation (on cgtalk) you made to a friend last week!

As for your problem, I am not sure what you mean exactly by rotational align? Is it possible that you attach a before after screenshots of what you want to achieve.

Light

 PEN

Try this

 $Cylinder02.rotation=slerp  $Cylinder02.rotation  $Cylinder01.rotation 0.5
 PEN

You might actualy have to do this to stop it from moving.


 rot=slerp  $Cylinder02.rotation  $Cylinder01.rotation 0.5
 in coordsys (transmatrix $Cylinder02.pos) $Cylinder02.rotation=rot
 

This code is untested, just off the top of my head but it should work.

This is from max help…

– Setting a node’s rotation relative to world space without
– messing with its position:
fn setNodeWorldRotation theNode theRot =
(
in coordsys (transmatrix theNode.transform.pos)
theNode.rotation = theRot
)
setNodeWorldRotation $ (eulerangles 45 45 0)

Thanks everyone! Paul, I think slerp is exactly what I was looking for – particularily since I can gradually rotate an object towards another with the 0…1 factor. Perfect I’ve been having problems with my objects rotating according to some weird pivot, so thanks for that tips as well, Paul and Rene.

Light: Thanks for the kind words! Actually I’ve just updated my site, but my old web-provider has problems pointing superrune.com to my new site. They’ve taken three weeks so far, and I am extremely anxious to show everyone my updated site.

If you are interested, surf over to http://www.runespaans.com and look around. I’ve even wrote some information about my feeble attempts at script-making (so it’s not an off-topic plug at all, hehe)

Rune