I have set of random generated points in 3D Scene, and in runtime I want to change the type of point markers to, for example, triangles, as in the picture:
Is it possible? How can I achieve this? Also I need change color for some points.
Scene initialization code below:
ILArray<float> points = ILMath.tosingle(ILMath.randn(3, 1000));
var scene = new ILScene
{
new ILPlotCube(twoDMode: false)
{
new ILPoints
{
Positions = points,
Color = null,
Size = 2
}
}
};
Markers (
ILMarker
) and 'points' (ILPoints
) are very different beasts. Markers are much more flexible configurable, mostly look nicer and are much more expensive to render. They commonly consist out of a border (line shape) and a filled area (triangles shape) and come with a number of predefined looks.ILPoints on the other hand are designed to be fast and easy. one can easily create millions of points without decreasing the plotting performance. Don't try this with markers! But such points are what they are: filled circles. It's it. No borders, no different shapes.
However, if you want to give it a try - even for the 1000 points in your questions - you can do so. Just use an
ILLinePlot
instead and configure a marker for it. You may set the line color toColor.Empty
to have the markers showing up alone.In order to get individual colors for individual point markers you would split your markers (points) up into individual set of points. Create an ILLinePlot for each set of points using the scheme described above.
The part of your question dealing with 'dynamic' is also easy: You can change the type of markers as well as any other property at runtime. Here is one simple example which toogles the markers between red triangle markers and white rectangle markers by clicking anywhere on the scene: