Notifications
Clear all

[Closed] Distance above a surface – Help

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

3 Replies

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

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

great thanks for the advice, I will give that a try.

-bnvm