Profile Picture

Custom Coloring For Surface: Vertex Colors vs Palette

Posted By Karl Baum 9 Years Ago
Author
Message
Karl Baum
Question Posted 9 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: Forum Members
Last Active: 9 Years Ago
Posts: 9, Visits: 23

Hi,
I am creating a surface plot.  The coloring will be based on the surface value (Nevron y axis value).  I have implemented this by assigning the appropriate color to each vertex.  By using NGridSurfaceSeries.Data.Colors.  I used this method because I found an example in the documentation.  I then stumbled across the concept of a palette.  The documentation seems to hint I can create a custom palette to do the same thing.

1) Are there any advantages/disadvantages to assigning a color to each vertex vs using a custom palette?
2) Are there any examples for using a custom palette?  Perhaps even creating it from a known look up table?
Thanks


Nevron Support
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
Hi Karl,

The preferred method in this case is to use a palette in ZoneTextureMode (in as this will decrease the amount of data transfer to the video board):
surface.FillMode = SurfaceFillMode.ZoneTexture;

Regarding the palette - the following code shows how to create a custom palette:

   surface.FillMode = SurfaceFillMode.ZoneTexture;
   surface.Palette.Clear();
   surface.Palette.Mode = PaletteMode.Custom;

   surface.Palette.Add(0, Color.Red);
   surface.Palette.Add(0.20, Color.Blue);
   surface.Palette.Add(0.40, Color.Green);
   surface.Palette.Add(1, Color.Yellow);

in this palette values that fall in the range [0, 0.2] will be colored red, [0.2, 0.4] Blue and so on.

Hope this helps - let us know if you have any questions.





Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic