Showing posts with label axis. Show all posts
Showing posts with label axis. Show all posts

Friday 2 February 2024

look at constraint but only in the X or Y etc

 


There's a Look At Constraint, in the Constraints tab, however if you only want this aim to work on the X, or maybe just the Y, you have to dig into the constraint, then go to the Common Tab (see top screenshot) and then only specify the rx or ry in the scope.

Remember to use Nulls to set custom pivots etc, then parent your desired geometry to the null.

Monday 26 September 2022

@scale

 I can't believe I've never used @scale....

@pscale is useful for uniformly scaling the instance/copied object onto a point. But what if you need to adjust the scale on a per-axis basis?

@scale=set(1,2,3);

this will scale the object by 2 in the Y, and 3 in the Z

woop woop

Tuesday 3 September 2019

rotating point normals, with vops

To rotate a point's normals (or any vector for that matter) you need to multiply it with a matrix and an angle (usually in radians) and around a specified axis.

A much neater/easier-to-grasp method is to use a VOP.
Give your points some initial Normal values, eg point them in X.

Make a point VOP.
Connect the N output into a multiply. We want to multiply this N vector and get a vector output.
The output of the multiply should go to the N output.

Make a DegToRad node (skip if you speak radians) and connect that to the angle input of a Rotate node. Promote the DegToRad's angle input so you can tweak it at object level.

In the Rotate node, set the vector that you wish to spin the normal vector around. It might be Y. 0,1,0.
Or you could be doing something  cool like calculating the vector that an edge lies on and spinning something around that.

Connect the output of the Rotate to the second input of the Multiply.

Now jump back out of the VOP and you should be able to see your normals rotating when you change the angle input.

-------------------------------------------------------

Of course this is just a couple, maybe one, of lines in VEX, but who really has time to memorise that? heh.

Tuesday 28 May 2019

spinning particles/points/rbds

I made a previous post about spinning particles with "w" and Pop Torque.... Walter uses this & it seems much simpler (?). In your DOP network, create a Pop Spin node & in the VEXpression space type:

spinspeed = 100*(fit01(rand(@id),chf("min"),chf("max")));
axis = sample_direction_uniform(rand(@id));


Spinspeed is measured in degrees per second
Axis specifies the axis of each point you're spinning. The sample_direction_uniform() function returns a normalised vector. So here, we have a completely randomised rotation axis. Not bad.