Prod.: Engine, ver.: 6018, ID: 60001175, Wish : Polyface gradient coloring by elevation

Wish : Polyface gradient coloring by elevation

Article60001175
TypeWish
ProductEngine
Version6018
Date Added6/23/2010
FixedYes [7/9/2010]
Submitted byWayne Romer
Keywords

Subject

Polyface gradient coloring by elevation

Summary

Polyface gradient coloring by elevation

Solution


In version 6019 a new property GradientColors was added in vdPolyFace object.


Description: Get/Set an array of elevations with their colors used for gradient rendering.


Example in C#:


 


//If the first entity in the Model entities is a vdPolyface object
//then select gradient colors for 5 diferent levels between minimum and maximum elevation of the entity bounding box
vdPolyface pf = doc.Model.Entities[0] as vdPolyface;
if(pf != null){
                ElevatedGradientColors elevColors = new ElevatedGradientColors();
                Box bound = pf.BoundingBox;
                int ncolors = 5;
                for (int i = 0; i < ncolors; i++)
                {
                    elevColors.SetAt(i * (bound.ZMax - bound.ZMin) / ncolors, doc.Palette[i].SystemColor);
                }
                pf.GradientColors = elevColors;
}

//GradientColors are supported only with  vdRender.Mode.Shade , vdRender.Mode.ShadeOn and vdRender.Mode.Render

doc.RenderMode = vdRender.Mode.Shade;