Measures Setup TUT
Xpresso, Tips & Tricks – by: base80
February 20th, 2006
Ever wanted to make measures in your model as to show the size of things. Here is a tut that explains how to do this.
It will display a distance between two given points.
[More:]
Start by making a null, call it “measure” and add an xpresso tag to it.
Add two nulls inside, call them Point 1 and Point 2, add a Target-Tag to both nulls. Point each target tag to the other null.
Add a small cone (to make the arrow shape) to both nulls with their top on the axes of the null and pointing in the reverse direction of the opposite null.
Now add a thin cylinder to the first null (Point 1).
Add a text spline to an ExtrudeNurb and place it at the centre of the cylinder.
Ok that was the modeling part.
Now we will make an xpresso that places the cylinder at the hart of both Point 1 and 2, and we will make the text correspond with the distance of the two points.
Drag the Point 1 and 2 nulls in the xpresso editor.
Connect their Positions (global) to a Distance-node.
Then drag the text node in the xpresso. Connect the distance node to the text-port of the text node. Now the text will show the distance between the two points, great.
In the setup I made I want round figures so I added a Absolute-node set to integer between them. And to make the text more fancy I added (math set to string mode) a constant that says ” Cm.” (in string mode too).
(I made a tutorial about “adding” text recently).
Now the second part of the setup is to determine the length of the cylinder between the two points and to place it at the hart of the two Points.
So we need to feed the Distance out-port to the length of the cylinder minus the length of the little cones at both sides. So connect the Distance node to a math node set to Subtract and fill in the amount to subtract by hand in the node and connect it to the Cylinder Hight port.
To position it correctly it needs to be halfway between the two Points. So take the out-port of the Distance node, divide it by 2 and connect it to the Z position of the cylinder.
Now move around the two points and the setup will measure and show the text as you expect.
As the xpresso tag resides on the parent null you can make as many copies of the measure-null as needed.