PDA

View Full Version : Distance above a surface - Help


bnvm
01-07-2005, 07:19 PM
I am trying to write a script that can tell me the height from the pivot point of an object above the surface of an object directly below it. Any suggestions would be great.

-bnvm

Rivendale
01-07-2005, 08:34 PM
Hey here's loosely what you could try:
Get the pivot of the object with... $.pivot or something like that.
then loop through the polygons of the surface and do a...
polyop.getFaceCenter
and check the distance to the pivotlocation you got with...
distance <point3> <point3>
then return the closest distance you find in the loop.

I would like to see an example of shooting rays to intersect with the editable poly surface below if anybody knows how to do that in a good way.

CML

Rivendale
01-07-2005, 11:24 PM
Another way to do it would be to use the new Question functions in max7. Here is the syntax:

polyop.questionObject $ "How far is it to the surface below?" spotlight:on doForce:true

eh...;) need some sleep now.

CML

bnvm
01-08-2005, 06:09 AM
great thanks for the advice, I will give that a try.

-bnvm

CGTalk Moderation
01-20-2006, 08:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.