3-vector to ramp ?

   7567   34   1
User Avatar
Member
767 posts
Joined: April 2014
Offline
If P is a vector and a spline ramp requires a float, how can I go from a vector to a float by using all three vectors instead of converting a vector to a float which limits to one vector within vops ?

I hope that made sense Inform me if I confused you
Edited by _Christopher_ - April 2, 2017 10:48:24
【T】【C】【S】
User Avatar
Member
2152 posts
Joined: Sept. 2015
Offline
Use dot notation for each element of the vector - P.x, P.y, P.z

Run each one through the ramp, doing it 3 times.

Or control each vector element with it's own ramp. Having 3 ramps.
Edited by BabaJ - April 2, 2017 10:27:10
User Avatar
Member
767 posts
Joined: April 2014
Offline
I didn't have time to edit my post

I must create three ramps and plug P into all three ramps converting each vector to a float ?
【T】【C】【S】
User Avatar
Member
2152 posts
Joined: Sept. 2015
Offline
Why do you want to convert the vector to a float?

Did you want to control each element of the vector per ramp?

If that's it use P.x for the first ramp, P.y for the second ramp and P.z for the third ramp.
Edited by BabaJ - April 2, 2017 12:09:34
User Avatar
Member
8173 posts
Joined: Sept. 2011
Offline
What you are asking doesn't make sense. A ramp is one-dimensional, position vector is a 3-space. You can't simply map one to the other implicitly. You can do what BabaJ said and map each axis to its own ramp, but then you end up with 3 values. It depends on what you are after. Think about what you are trying to achieve. Various scalar mappings can be embedded in 3-space, such as distance functions. For example, you could fit the distance to the origin into a ramp to make a radial ramp pattern, or use an unsigned box function to make a distance to a cube. If you take the 3 axes and plug into 3 ramps, and combine the values into a color, you've just created a cube 3D LUT. Unfortunately there is no native ‘3d lut’ widget to allow for directly editing a 3-space to color mapping, so 3 scalar ramps will have to do. You could look into a color grading package like Davinci Resolve for a more comprehensive tool to create 3D cube luts.
User Avatar
Member
767 posts
Joined: April 2014
Offline
At the moment if I plug the point position into ramp with a conversion in-between and the conversion between the point position and the input of a spline ramp is set to Y; all the points align along the Y; Instead of effecting the Y but not having all the points aligned along the Y axis ?
【T】【C】【S】
User Avatar
Member
767 posts
Joined: April 2014
Offline




The points are aligned on the Y, rather then on all three axis, while giving me the control to manipulate only the points on the Y ?
【T】【C】【S】
User Avatar
Member
9249 posts
Joined: July 2007
Offline
you are completely ignoring P.x and P.z and setting just Py, that's why you see points only along Y
if you want to reuse P.x and P.z from input then you have to connect them
so connect first and third output of vectortofloat1 to first and third input of floattovec2
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
767 posts
Joined: April 2014
Offline
@tamte - The input of ramp only can take one vector; this is the dilemma ?
【T】【C】【S】
User Avatar
Member
9249 posts
Joined: July 2007
Offline
no, that's fine
you can have just one float lookup value per ramp
and in your case you want to modify the ramp based on P.y, so that's correct

if you want to use your ramp for more lookup values, you can simply duplicate the ramp node and as long as they have the same parm name, they will all appear as the same ramp in UI
or of course you can have different ramp curve in UI per each, up to you
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
767 posts
Joined: April 2014
Offline
@tamte - Except the attribute vop node is still only show one vop. I'm manipulating the Y with the spline but I'm not visually seeing all three vectors of the previous node to which I'm manipulating with the attribute vop ?
【T】【C】【S】
User Avatar
Member
9249 posts
Joined: July 2007
Offline
tamte
if you want to reuse P.x and P.z from input then you have to connect them
so connect first and third output of vectortofloat1 to first and third input of floattovec2
did you do this?
and you still seeing all the points only along Y?

or in simple terms, what are you trying to do?
1. do you want to control with one ramp distribution of all the points in Y in without modifying X,Z?
2. do you want to control with one ramp distribution of all the points in XYZ the same way?
3. do you want to control with 3 ramps distribution of all the points in XYZ separately?
4. ?
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
767 posts
Joined: April 2014
Offline
To answer your first question, the answer is; yes

1. do you want to control with one ramp distribution of all the points in Y in without modifying X,Z?
This is my goal

2. do you want to control with one ramp distribution of all the points in XYZ the same way?
Do you mean have the ramp control all three vectors ?
【T】【C】【S】
User Avatar
Member
9249 posts
Joined: July 2007
Offline
1. again, from your screenshot:
tamte
connect first and third output of vectortofloat1 to first and third input of floattovec2

2. sure, if you want to, as I described:
tamte
if you want to use your ramp for more lookup values, you can simply duplicate the ramp node and as long as they have the same parm name, they will all appear as the same ramp in UI
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
767 posts
Joined: April 2014
Offline
Sorry, if I'm mis-understanding, once again

The ramp only accepts a float, therefore converting a vecToFloat > floatToVector wouldn't plug into a spline ramp.



Updated network shows what you described; as you mentioned the X,Z points continue to be modified ?
【T】【C】【S】
User Avatar
Member
9249 posts
Joined: July 2007
Offline
it doesn't really show that
as you are plugging all to add

just plug them to float to vector node and then to P
then you will get case 2. single UI float ramp, that acts as lookup for each component of P (within 0-1 range)
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
9249 posts
Joined: July 2007
Offline
anyway, I will post a file with all 3 options once I get home, just to save you from blindly trying random stuff
Edited by tamte - April 3, 2017 20:23:40
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
767 posts
Joined: April 2014
Offline
tamte
it doesn't really show that
as you are plugging all to add

just plug them to float to vector node and then to P
then you will get case 2. single UI float ramp, that acts as lookup for each component of P (within 0-1 range)

I see my mistake Moronic I was.

How do I get case 1 ?
【T】【C】【S】
User Avatar
Member
9249 posts
Joined: July 2007
Offline
a bit of inception
tamte
1. again, from your screenshot:
tamte
connect first and third output of vectortofloat1 to first and third input of floattovec2
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
9249 posts
Joined: July 2007
Offline
3 above mentioned examples with P controlling ramp directly
- 1. single ramp controlling just y
- 2. single ramp controlling all P components (xyz)
- 3. 3 separate ramps controlling corresponding P components (xyz)

and

3 similar examples where relative P position within bbox conrols ramp
Edited by tamte - April 4, 2017 03:31:18

Attachments:
ramp_stuff.hip (366.8 KB)

Tomas Slancik
CG Supervisor
Framestore, NY
  • Quick Links