Jump to content
Sign in to follow this  

[Xpresso] Converting a rotational degree to a fraction

Recommended Posts

Hey guys!


First some background on the project, if you're curious. For tl;dr pop down to the second paragraph.


I'm woking on a scene in C4D where I want a "trail" coming off an object to bank along with that object as it moves through space. Right now I have a long thin rectangle nested in a Sweep NURBS along with a Tracer Object. This produces the trail I want, but because the Sweep NURBS does not look at the rotational values of my rectangle, there's no banking occurring even if the rectangle would be constrained to the bank of the object which is producing the trail.


The solution I've hatched up (which seems close to working) is to use xpresso to connect the bank of the leading object directly to the initial rotation found within the 'details' section of the sweep NURB. The only problem now is that the value of the Sweep NURBS internal rotation feature is mapped from two user-determined values on a 0-1 scale...not a true degree system. Mine is set to the default of -180˚ to 180˚, meaning that a rotational value of 0 would be entered into the graph as the exact midpoint, 0.5 .


The challenge I have is finding a formula to convert my bank rotation into a 0-1 scale that reflects rotation between -180˚ and 180˚. Does anyone have any tips on performing this sort of operation in C4D, or might know any resources worth consulting?





Edited by SFBurning

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...