Select to view content in your preferred language

An object's position in the world coordinate system

782
1
06-21-2020 03:17 AM
AlexanderTemnyakov
New Contributor

Good day,

I placed some objects on streets and I want to export their positions. I read in the documentation about the pivot, then I tried to export pivot.p(x|y|z), but these coordinates are strange. The documentation says they are relative to initialShape.origin, but I don't think so. For example, the initialShape.origin is (2, 0, 1), the street has length 10, but pivot.p(x|y|z) of some placed object may be (70, 0, 54).Why? How can the positions of placed objects be exported? I want to export the positions of the spheres in the attached screenshot.

Thank you for answers.

0 Kudos
1 Reply
CherylLau
Esri Regular Contributor

To get the position of the spheres in the world coordinate system, you don't want to use the pivot.  Instead, it's easier to use convert() to convert from scope coordinates to the world coordinate system.  For each sphere, you can convert the scope's origin (or the scope's center - whatever point you want) to world coordinates as follows:

convert(x, scope, world, pos, 0, 0, 0)  // x coord in world coords
convert(y, scope, world, pos, 0, 0, 0)  // y coord in world coords
convert(z, scope, world, pos, 0, 0, 0)  // z coord in world coords

convert function—ArcGIS CityEngine Resources | Documentation