Box library

I am trying to use the box. The matrix scale doesn’t seem to be determined by the ‘size’ property of the box. I’m guessing this isn’t the right behaviour.

Also, the Box size should probably default to 1.0

hello guest, that is actually the correct behavior. its similar to the Box (Geometry) in vvvv if you set a different size than the default. so totally agreed on setting size = 1 as default!

first tip is use AlignedBox if you don’t need rotation, its the natural extension of the Rectangle data type into 3D, which also cannot be rotated.

more on Box:
the full description of an arbitrary box in space is defined by its size in each axis, position and rotation. so it could be encoded into two 3D vectors + a quaternion. also one matrix that holds all three would be possible, as you assumed. what the Box actually stores is its ‘Extends’ or ‘Radii’ that is similar to the radius of a sphere and a transformation matrix that should contain translation and rotation. you see that when hovering over a pin of type Box. the reason for this choice is that there are many complicated collision algorithms defined for Box and they can be computed most efficiently with this set of data. and they are most precise if the matrix does not contain scaling.

so to get the scaling use the Size [Box] node to get what you put in to the constructor. use GetSize to get the size of the box transformed by its matrix, but you only need that if the matrix has scaling applied.

or just setup the box with size = 1 and then transform it with matrices all the way…

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.