pt.SpatialReference = surface.Domain.SpatialReference
Hi,
this thread describes how to get the spatial reference by casting the layer to an IGeoDataset.
http://forums.esri.com/Thread.asp?c=159&f=1707&t=223709
A ISurface has also a reference in its domain attribute, you can try this too.pt.SpatialReference = surface.Domain.SpatialReference
I can send you my mail address as private message, but you have to enable it in your forum settings first.
Public Sub RefreshView() Dim pSxDoc As ISxDocument pSxDoc = My.ArcScene.Application.Document pSxDoc.Scene.SceneGraph.Invalidate(pSxDoc.Scene.SceneGraph.ActiveViewer, True, True) pSxDoc.Scene.SceneGraph.RefreshViewers() End Sub Private Sub btnRun_Click(sender As System.Object, e As System.EventArgs) Handles btnRun.Click Dim pSxDoc As ISxDocument pSxDoc = My.ArcScene.Application.Document Dim pScene As IScene pScene = pSxDoc.Scene Dim pLayer As ILayer Dim theLayer As String = cboLayer.Text pLayer = GetLayer(theLayer) Dim theFLayer As IFeatureLayer Dim theFClass As IFeatureClass theFLayer = pLayer theFClass = theFLayer.FeatureClass Dim theFeatCursor As IFeatureCursor Dim theFeature As IFeature theFeatCursor = theFClass.Search(Nothing, False) theFeature = theFeatCursor.NextFeature While Not theFeature Is Nothing Dim geom As IGeometry geom = theFeature.ShapeCopy geom.Project(pScene.SpatialReference) Dim thePoint As IPoint thePoint = geom GL.glPointSize(15.0F) GL.glColor3ub(255, 0, 0) GL.glBegin(GL.GL_POINTS) GL.glVertex3f(thePoint.X, thePoint.Y, thePoint.Z) GL.glEnd() theFeature = theFeatCursor.NextFeature End While RefreshView() End Sub
Hello. Sorry for disturbing, but I have a same problem and I simply don't understand a source of that problem. I tried to drawing the OpenGL point, as you can see in the code below, but it doesn't work! Sorry for my english either.
Could you share with me your VB code? Some examples? Please! I never worked with OpenGL before.
ISceneGraphEvents_Event events = axSceneControl1.SceneGraph as ISceneGraphEvents_Event;
events.AfterDraw += new ISceneGraphEvents_AfterDrawEventHandler(events_AfterDraw);
void events_AfterDraw(ISceneViewer pViewer)
{
ISceneControlEvents_OnMouseDownEvent events = e;
if (events != null)
{
ISceneGraph pSceneGraph = axSceneControl1.SceneGraph;
object pOwner = null, //слой
pObject = null; //объект, на который указывает мышь
IPoint point = null;
pSceneGraph.Locate(pSceneGraph.ActiveViewer, events.x, events.y, esriScenePickMode.esriScenePickFastLocation, true, out point, out pOwner, out pObject);
if (point != null)
{
IGeometry geom = point as IGeometry;
geom.Project(axSceneControl1.Scene.SpatialReference);
point = geom as IPoint;
Gl.glPointSize(999.0f);
Gl.glColor3ub(0, 0, 0);
Gl.glBegin(Gl.GL_POINTS);
Gl.glVertex3d(point.X, point.Y, point.Z);
Gl.glEnd();
Gl.glFlush();
axSceneControl1.Invalidate();
}
}
}
Please... someone... I need help)