I had great success using ObjectModel3D objects in my XAML file. However, I would like to dynamically add and remove objects based on user input. For this reason, I’ve switched to using codebehind.
private void PopulateScene() { List<Uri> bitmapImages = DataProcessor.bitmapImages(); Uri textureSource = new Uri(@"C:\Users\Will\Desktop\lemon_yellow__85006.webp"); var rotation = new Rotation3D() { Angle = 45, Axis = SciChart.Charting3D.Axis.Axis3D.YAxis }; foreach(Uri bitmapImage in bitmapImages) { ObjectModel3D objectModel = new ObjectModel3D() { TextureSource = new TextureSource(textureSource), Source = new ObjectModelSource(new Uri(@"C:\Users\Will\Desktop\EarthTile.obj")), Position = new Vector3(1, 0, 1), CoordinateMode = ObjectCoordinateMode.Relative, Scale = new Vector3(2, 1, 1), Rotation = rotation }; using (sciChart.SuspendUpdates()) { sciChart.SceneObjects.Add(objectModel); } } }
I get the correct model with the correct texture. However, setting the position, scale or rotation doesn’t seem to work. All objects are in the same place ((0, 0, 0), no matter the coordinate mode), at the same (1, ,1 ,1) scale, and facing the same direction. How
I also have this function;
private void ClearScene()
{
using (sciChart.SuspendUpdates())
{
sciChart.SceneObjects.Clear();
}
}
Even after the object is cleared from SceneObjects, it persists in the chart.
This leads me to my 2 questions;
- How do I get the objects I add to the chart to observe the
transformational parameters I give it? I don’t need to change the
parameters of objects after they’ve been added to the scene, just
before. - How do I remove objects from a scene?
- Will Wright asked 1 year ago
- last edited 1 year ago
-
Hi Will, Thanks for your inquiry. I’m forwarding it to our developers and will get back to you as soon as I have an update. With best regards, Lex
-
Hi Will, We’ve discussed your inquiry and we have planned to create a sample project for you. However, the soonest we can look at it is next week. Is this time frame comfortable for you? With best regards, Lex
-
Sounds like a plan. Thanks!
-
Was there any update on the sample project?
- You must login to post comments
Hi Will,
I’m glad to inform you that we’ve prepared a sample project showing how 3D objects can be dynamically added to the SciChart 3D Surface. Please find it attached.
Please let us know if this helps.
With best regards,
Lex
SciChart Technical Support Engineer
- Lex answered 1 year ago
- You must login to post comments
Please login first to submit.