Getting elevation by coordinates


#1

Hello everybody and good day!

I recently started scripting in max and dont have very big background, so to say. I have a problem to solve which is kicking my brains. Two, actually…

  1. as a part of a script in a procedure, how can I find the extremities of the whole scene, including all objects altigether? That is the max and min x, y and z coordinates. I will use it as a function ;

  2. again as a function, for a given x and y to return list of z(), probably array.

I know maybe this is too easy for you, gurus, but im kind of struggling. I will be very happy for any clue you could give me. Thanks in advance.


#2
  1. Use objects.min and objects.max
  2. cross (normalize x) (normalize y)

#3
  1. Thank you, simple as that, objects.min and max will do the job.
  2. Cross function returns the cross product of two vectors, that is another vector. I need to have a list of all the z where a vertical line penetrates the scene in coordinates (x,y). I dont see a way to implement this with cross. Please help.

Thank you very much and excuse me for bothering


#4

Since you do not have Z value then any Z value can be used. Your coordinate is: [x,y] adding Z to this gives you all possible Z that you need - [x,y,100] is just 70 units above [x,y,30] on the same Z axis(line).


#5

elevation by coordinates

intersectRayScene <ray> is probably what you need

Performs intersectRay on all nodes in the scene.

Returns an array of results, one entry per node hit, where each entry is a 2 element array containing the node and the intersectRay result for that node.


#6

Thank you, Serjah, I believe this will do the magic. Now it is time to implement it in my code, which will take time. Thanks for the tip.