relbbox alternative function ?

   4703   10   1
User Avatar
Member
760 posts
Joined: April 2014
Offline
What is the alternative to relbbox in vex & vops ?
【T】【C】【S】
User Avatar
Member
8514 posts
Joined: July 2007
Online
why do you need alternative when you have relbbox in both?

but you can always just get the actual bbox and fit P from bbmin and bbmax to 0 an 1
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
760 posts
Joined: April 2014
Offline
I'm an idiot for the first question, sorry tamte

but you can always just get the actual bbox and fit P from bbmin and bbmax to 0 an 1

?
【T】【C】【S】
User Avatar
Member
8514 posts
Joined: July 2007
Online
so to get equivalent of :
vector relbbox = relbbox(@P);
you can do:
vector bbmin, bbmax; //initialize variables
getbbox(0, bbmin, bbmax); //populate them with real bbox min and max values
vector relbbox = fit(@P, bbmin, bbmax, 0, 1); // and fit @P from real bbox range to 0-1 range to get relbbox
// note that 0, 1 are automatically cast to vector
// so you don't have to write {0,0,0}, {1,1,1} here, but you still can
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
760 posts
Joined: April 2014
Offline
This is the equivalent in vops ?

【T】【C】【S】
User Avatar
Member
8514 posts
Joined: July 2007
Online
relbbox1 already provides what you want

and the equivalent is the network you have without relbbox1 node
just P connected directly to fit2 val
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
760 posts
Joined: April 2014
Offline
I assume relbbox is redundant, although it is being evaluated regardless, or no ?
【T】【C】【S】
User Avatar
Member
8514 posts
Joined: July 2007
Online
not sure what you mean

relbbox() is a function that will return for each position sample it's relative normalized position within bounding box of the specified file geometry or input
it's evaluated only when you call it

if for whatever reason you don't want to use it, then to get the same result you can use getbbox() and fit() functions as I described
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
760 posts
Joined: April 2014
Offline
if for whatever reason you don't want to use it, then to get the same result you can use getbbox() and fit() functions as I described

What I meant was, the vop network I posted in my previous post, regardless if the relbbox is in the network or not as you suggest it's not required. If I were to keep it in the network, it would work the same as if I plugged P into (val) of the fit node ?

relbbox() is a function that will return for each position sample it's relative normalized position within bounding box of the specified file geometry or input
it's evaluated only when you call it

relbbox is a function that returns each point position sample which is relative to the most normalized position within the bounding box of the specified file or input ? I hope my explanation wasn't confusing ?
Edited by _Christopher_ - March 29, 2017 08:42:53
【T】【C】【S】
User Avatar
Member
166 posts
Joined: March 2014
Offline
Christopher_R
What I meant was, the vop network I posted in my previous post, regardless if the relbbox is in the network or not as you suggest it's not required. If I were to keep it in the network, it would work the same as if I plugged P into (val) of the fit node ?
No, it would not work the same. Your current network does not output what you want unless the bounding box of your object goes exactly from 0,0,0 to 1,1,1. And in that case you would not need the fit or the other bbox node at all because the relbbox already outputs the correct value.

The relbbox outputs a value between 0 and 1, depending on how close to the bounding box limit the point is. P outputs a world position, which is what you would need to feed into the Fit of your network.
Edited by Digipiction - March 29, 2017 11:12:33
User Avatar
Member
760 posts
Joined: April 2014
Offline
and the equivalent is the network you have without relbbox1 node
just P connected directly to fit2 val

No, it would not work the same. Your current network does not output what you want unless the bounding box of your object goes exactly from 0,0,0 to 1,1,1. And in that case you would not need the fit or the other bbox node at all because the relbbox already outputs the correct value.

Since P outputs a world position, I can bypass the relbbox node and use fit. Although if I use relbbox node, I can bypass using bbox and fit nodes since, as you said Chris_TC the relbbox node already outputs the correct value between 0-1 ?
【T】【C】【S】
  • Quick Links