This is almost a philosophical question. I have a 3D object in ArcScene which has been created by someone else (the User).

ESRI does not provide any indication of the X,Y,Z axis directions in ArcScene but I need to know this so I can align labels.

The Problem:

I can find a point on the 3D plan by scanning the screen using m_pSxDoc.Scene.SceneGraph.Locate(iXpix, iYpix...pPoint...)

If pPoint comes back with a value then it means a point on the map has been found. The return point has (X,Y,Z) coordinates.

I then get the coordinates of the point located one pixel to the right. This is done to find which axis is the one running left-right on the screen. If Xo <> X1 and Yo = Y1 and Xo = X1 then the left-right axis is the one which uses the first coordinate in the point coordinates.

Do the same again taking a pixel up to get the up-down axis.

This process works fine if the point found is on a plane parallel to one of the coordinate planes.

It is not often the case that the first point found is on a parallel plane. The whole drawing may not have a single parallel plane in it.

OK I thought. The chances of finding a parallel plane are slim so just generate one and use that. I did this (using ArcObjects) and then realised that to construct the plane you have to assume a set of X,Y,Z coordinate directions. Any queries on that plane will just find the directions assumed for it's construction. Bomb out.

The Question:

How do I find the left-right, up-down and front-back axis directions from a set of point coordinates?

ESRI does not provide any indication of the X,Y,Z axis directions in ArcScene but I need to know this so I can align labels.

The Problem:

I can find a point on the 3D plan by scanning the screen using m_pSxDoc.Scene.SceneGraph.Locate(iXpix, iYpix...pPoint...)

If pPoint comes back with a value then it means a point on the map has been found. The return point has (X,Y,Z) coordinates.

I then get the coordinates of the point located one pixel to the right. This is done to find which axis is the one running left-right on the screen. If Xo <> X1 and Yo = Y1 and Xo = X1 then the left-right axis is the one which uses the first coordinate in the point coordinates.

Do the same again taking a pixel up to get the up-down axis.

This process works fine if the point found is on a plane parallel to one of the coordinate planes.

It is not often the case that the first point found is on a parallel plane. The whole drawing may not have a single parallel plane in it.

OK I thought. The chances of finding a parallel plane are slim so just generate one and use that. I did this (using ArcObjects) and then realised that to construct the plane you have to assume a set of X,Y,Z coordinate directions. Any queries on that plane will just find the directions assumed for it's construction. Bomb out.

The Question:

How do I find the left-right, up-down and front-back axis directions from a set of point coordinates?

John,

What about the IPoint.SpatialReference property of the points that you retrieve? I would assume that you should be able to get the direction information from it. For example, if the spatial reference is based on a projected coordinate system, you might try and cast it to IProjectedCoordinateSystem2 and query the XScaleFactor and YScaleFactor properties.

Fridjof