Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a custom renderer which need to render modified geometry. The input features are all coming in via the IFeatureCursor as polygon elements. (This is similar to this example, though I'm not rendering points.)

I can easily render Polygons, Lines, and Points via either passing the new geometry into IFeatureDraw.Draw or calling IDisplay.DrawPolygon/IDisplay.DrawPoint/etc.

However, IDisplay does not provide a mechanism for drawing a multipatch, and passing this in as the geometry to IFeatureDraw.Draw results in nothing drawn to the screen.

Is there a way to directly "draw" a multipatch element (preferrably with texturing), within this method?

share|improve this question
    
Is this in 2D Display (ArcMap) or in ArcScene or Globe? –  Craig Williams Jul 30 '11 at 5:17
    
@Craig: This needs to be supported in all three, though I'm willing to use multiple code paths to handle it. This is for a plugin data source, so the support will need to be "global.' –  Reed Copsey Aug 1 '11 at 16:11

2 Answers 2

up vote 3 down vote accepted
+50

As Craig says, OpenGL is the way to go for 3D.

See Creating an ArcGIS Engine Application With C-Sharp and OpenGL. Earlier versions of ArcGIS Explorer also supported OpenGL calls, but last time I checked Esri no longer supports it.

I don't know why they did this - OpenGL drawing really helped differentiate AGX from Google Earth.

Update

Even if your plugin returned multipatches correctly, I don't think ArcObjects offers methods to support drawing multipatches with OpenGL calls. It would likely be easier to just draw from their native format (by-pass the plugin in other words). I've never used it, but here's a script that shows how to use OpenGL with ArcScene.

share|improve this answer

2D display (IDisplay) does not support drawing multipatches directly. You'll need to covert them to footprints (see IMultipatch::XYFootprint for how to extract the footprint). If you want a 2D rendering of the multipatch textures you'll need to create an image from a 2D projection of the multipatch and draw that.

For 3D, you should be able to just return mulitpatches in the cursor and it will work but honestly most people just implement a custom layer for globe and do their own work in OpenGL.

share|improve this answer
    
I'm trying to support ArcScene primarily (not Globe), but also map/globe as secondary. Unfortunately, returning multipatches in the cursor doesn't work in a plugin dataset properly, from what I can tell... –  Reed Copsey Aug 4 '11 at 15:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.