This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create variables | |
vector tangentv = v@tangentv; | |
vector tangentu = v@tangentu; | |
tangentv = cross(tangentu, @N); | |
float seed = ch('seed') + @primseed; | |
@up = tangentu; | |
//define rotations YAW | |
float RandYaw= fit01(rand(i@ptnum+seed+225), -ch('rand_yaw'), ch('rand_yaw')) * chramp("ramp_yaw", @curveu); | |
float Yaw = chf('yaw') * chramp('ramp_yaw', @curveu) + 0.001; | |
//apply rotations YAW | |
@Yaw = Yaw; | |
RandYaw = RandYaw; | |
vector4 rot = quaternion(radians(Yaw+RandYaw), tangentv); | |
@N = qrotate(rot, @N); | |
@N = normalize(@N); | |
//define rotations ROLL | |
float RandRoll= fit01(rand(i@ptnum+seed+225), -ch('rand_roll'), ch('rand_roll')) * chramp("ramp_roll", @curveu); | |
float Roll = chf('roll') * chramp('ramp_roll', @curveu); | |
@Roll = Roll; | |
@RandRoll = RandRoll; | |
//apply rotations ROLL | |
vector4 rotr = quaternion(radians(Roll+RandRoll), tangentu); | |
@N = qrotate(rotr, @N); | |
@N = normalize(@N); | |
//define rotations TWIST | |
float RandTwist= fit01(rand(i@ptnum+seed+225), -ch('rand_twist'), ch('rand_twist')) * chramp("ramp_twist", @curveu); | |
float Twist = chf('twist') * chramp('ramp_twist', @curveu); | |
@RandTwist = RandTwist; | |
@Twist = Twist; | |
//apply rotations TWIST | |
vector4 rott = quaternion(radians(Twist+RandTwist), @N); | |
@up = qrotate(rott, @up); | |
@up = normalize(@up); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
REQURIED ATTRIBUTES:
resample:
curveu
polyframe:
N (if its a straight line, might need to define N before polyframe)
tangentu
tangentv