Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Use gravity for Z position

Miha Nahtigal
Participant
My Addon creates API_Element (GDL object) on user specified coordinates acquired with APIIo_GetPointID. X and Y coordinates are ok, Z coordinate is always zero.

I would like to use gravity when picking a point on eg Mesh so Z coordinate gets populated too.

Is this possible?
3 REPLIES 3

Miha Nahtigal
Participant
Talking to myself a bit more...

I could use TDGetHeightAtPoint() which will "Calculate the height of a triangulated mesh at a given location."

Unfortunately one of the parameters is a list of triangles. Browsing through mesh type and its memo, I do not think I can extract them from specified existing mesh.

To go a bit further... there is also a TDTriangulate() function. Wouldn't be a bit overkill using it on already defined (and triangulated) mesh?

Ralph Wessel
Mentor
vuego wrote:
My Addon creates API_Element (GDL object) on user specified coordinates acquired with APIIo_GetPointID. X and Y coordinates are ok, Z coordinate is always zero. I would like to use gravity when picking a point on eg Mesh so Z coordinate gets populated too.
I don't know if there is a shortcut to achieving this. You could get the 3D body of the mesh from ModelAccess or the older 3D Manager (ACAPI_Element_Get3DInfo etc). You could then determine which face lies directly under the point of interest and the z level on the plane at that point.
Ralph Wessel BArch

Miha Nahtigal
Participant
I've decided to change my object creation concept.

Switched from APIelement creation to new element event observer and let user use default gravity functionality of AC. API magic is fired afterwards.

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!