Cuneyt Ozdas Forum
Cuneyt Ozdas Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 English - Software Support
 CounterText (Eng)
 Distance in feet - counter text
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

themadanimator
Starting Member

USA
4 Posts

Posted - 12/07/2007 :  17:40:03  Show Profile
I would like to show the distance between 2 objects as it changes using countertext. Is this possible? If so, can anyone help me with the expression?

Thanks!

Admin
Forum Admin

Turkey
649 Posts

Posted - 17/07/2007 :  02:26:28  Show Profile  Visit Admin's Homepage
Hi,

Yes. You can do that by assigning a float expression to the "user count" parameter of the counter text and entering the distance formula as the expression. Though it's not easy (though not impossible) to have it in imperial units.


Here is the step-by-step instructions for max9 (Decimal output)

1. right click on the counter text object and choose "Curve Editor"
2. in the curve editor locate "User Count" under "Object (Counter Text)". Select it
3. from the track view "Controller" menu choose "Assign..." (or press C)
4. Select "Float Expression" in the list and click OK. Expression controller window should be open now.
5. In the "Create variables" section create 2 "vector" variables named posA and posB. In the vectors list you should see posA and posB now.
6. select "PosA". Click "Assign to Controller" button. a "Track View Pick" window should open
7. in the tree locate the first object, under it expand the Transform section and select the "Position" item. Click OK
8. repeat steps 6 and 7 but this time for PosB variable and the second object in your scene
9. in the "Expression" part of the Expression Controller window, enter "length(posA-posB)"
10. Click "Evaluate".
11. If you received no warnings and the counter text value is updated then it's all set. Close the expression control window with the close button.
12. you can use %f or %g in the counter text string for the distance replacement

here is a sample scene for max9
http://www.cuneytozdas.com/forum/attachments/countertext_distance_max9.zip

hope this helps

/Cuneyt
Go to Top of Page

themadanimator
Starting Member

USA
4 Posts

Posted - 17/07/2007 :  04:45:22  Show Profile
I really appreciate your help. This is a very useful tool. Great work.
Go to Top of Page

themadanimator
Starting Member

USA
4 Posts

Posted - 03/08/2007 :  21:08:50  Show Profile
One more question, the distance is displaying in inches. Can I change it to feet some how? Thanks again.
Go to Top of Page

Admin
Forum Admin

Turkey
649 Posts

Posted - 03/08/2007 :  23:45:57  Show Profile  Visit Admin's Homepage
you can divide the inch value by 12 to get feet

so instead of entering "length(posA-posB)" enter "length(posA-posB)/12". You'll get a decimal feet value. You can not easily get 5'10" format unfortunately.

/Cuneyt
Go to Top of Page

themadanimator
Starting Member

USA
4 Posts

Posted - 04/08/2007 :  02:43:52  Show Profile
Exactly what I needed, thanks.
Go to Top of Page

youngdaniel
Starting Member

2 Posts

Posted - 10/05/2008 :  21:47:23  Show Profile
How can this work when the object is assign to a path constraint?

The problem is my box is assigned to a path constraint, so that it follows the path.

When I do this, the counter text fails to update.

The path constraint works to a percentage, and has no reference to the position!

Do you know how I can obtain the position of the box when it is on a path constraint?
Go to Top of Page

Admin
Forum Admin

Turkey
649 Posts

Posted - 10/05/2008 :  23:59:12  Show Profile  Visit Admin's Homepage
Hi,
yeah in case of path constraint, you can't get the position from the controller as I suggest above. In that case you can use "Float Script" controller instead of "Float Expression" and you can enter a script to get the required value from the scene.



Example float scripts:

$Teapot01.pos.x
provides the x position of the Teapot01 object

distance $Teapot01.pos $Box01.pos
provides the distance between $Teapot01 and Box01 objects (distance between pivots)



This works with path constraint too.

/Cuneyt
Go to Top of Page

youngdaniel
Starting Member

2 Posts

Posted - 11/05/2008 :  12:13:15  Show Profile
Amazing!
Thank you so much!
This tool has saved my university coursework from collapsing!
I never thought it would be possible animate the text in this way so easily!!
Go to Top of Page

LatoniaBarry
Starting Member

3 Posts

Posted - 03/04/2013 :  05:53:05  Show Profile  Visit LatoniaBarry's Homepage
One more question, the distance is displaying in inches.

________________
Best deals on latest series for http://www.largedvd.co.uk/ buy dvds in our shop can let you get more discount!
Go to Top of Page

konglong
Starting Member

Germany
3 Posts

Posted - 24/04/2013 :  16:11:16  Show Profile  Visit konglong's Homepage
I really appreciate your help. This is a very useful tool. Great work.

WoW Gold|Diablo 3 Gold|GW2 gold|WoW Gold kaufen
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
Cuneyt Ozdas Forum © 2000 - 2003 Cuneyt Ozdas Go To Top Of Page
This page was generated in 0.08 seconds. Snitz Forums 2000