how to make mormals to a specified range.
4783 7 1- luoqiulin
- Member
- 306 posts
- Joined: May 2007
- Offline
- asnowcappedromance
- Member
- 512 posts
- Joined: July 2009
- Offline
you can calculate the length of the vector either in VOPs or with an hscript expression, or however you want to do it:
length (float x, float y, float z)
when you have length A and B you can subtract them to get the difference, which you then can add to each component of the shorter vector, that should give you matching lengths.
cheers,
Manuel
length (float x, float y, float z)
when you have length A and B you can subtract them to get the difference, which you then can add to each component of the shorter vector, that should give you matching lengths.
cheers,
Manuel
- luoqiulin
- Member
- 306 posts
- Joined: May 2007
- Offline
asnowcappedromance
you can calculate the length of the vector either in VOPs or with an hscript expression, or however you want to do it:
length (float x, float y, float z)
when you have length A and B you can subtract them to get the difference, which you then can add to each component of the shorter vector, that should give you matching lengths.
cheers,
Manuel
thank you, but i dont know weather i dont understand your idea or i have not cleared my mean.
i want set points' normal as the referenced normal, but with some rand offset
- keyframe
- Member
- 1533 posts
- Joined: July 2005
- Offline
- luoqiulin
- Member
- 306 posts
- Joined: May 2007
- Offline
- zarti
- Member
- 330 posts
- Joined: July 2007
- Offline
- liuxiaolin
- Member
- 53 posts
- Joined: May 2010
- Offline
If you already have an offset between ref normal, and now want to fit this offset to a certain range,you can compute its anglebetween, and fit range ,then use this resault angle to rotate it ,axis is the cross product.
if not, are you just want a random resault around ref normal? generate a random vector,cross production make it orthogonal with refnormal,and use it to rotate ref normal a random angle
Or use sin(rad)*normalize(randomOrthogonal)+cos(rad)*normalize(refnormal)instead of rotate().
if not, are you just want a random resault around ref normal? generate a random vector,cross production make it orthogonal with refnormal,and use it to rotate ref normal a random angle
Or use sin(rad)*normalize(randomOrthogonal)+cos(rad)*normalize(refnormal)instead of rotate().
- luoqiulin
- Member
- 306 posts
- Joined: May 2007
- Offline
-
- Quick Links