Reputation: 3125
I have a wpf application, and I am spawning a dynamic point cloud using: xaml:
<hx:PointGeometryModel3D
Geometry="{Binding Points}"
Transform="{Binding Points1Transform}"
IsRendering="True"
FixedSize="True"
Size="5.5, 5.5"
Color="#00FF1B" />
Code behind:
public PointGeometry3D _Points;
public PointGeometry3D Points
{
get { return _Points; }
set
{
if (_Points != value)
{
_Points = value;
OnPropertyChanged(null);
}
}
}
public Transform3D Points1Transform { get; set; }
Points1Transform = new TranslateTransform3D(0, 0, 0);
Points = new PointGeometry3D { IsDynamic = true, Positions = new Vector3Collection() };
and updating the positions on a timer with:
public void ProcessingEventHandlerMap(object sender, DllFunctions.DenseTrackingFunctions.ProcessingEventArgsMap args)
{
try
{
if (_Data.GotData == true)
{
Points.ClearAllGeometryData();
Points.ClearOctree();
Points.Positions.Clear();
for (int j = 0; j < _Dense._processingArgsMap.pointData.Count(); j++)
{
Points.Positions.Add(new Vector3((float)_Dense._processingArgsMap.pointData[j].position[0] * 10, (float)_Dense._processingArgsMap.pointData[j].position[1] * 10, (float)_Dense._processingArgsMap.pointData[j].position[2] * 10));
Points.UpdateVertices();
}
}
}
catch (Exception e)
{
// I broke
}
}
This works perfectly, and I now need to replicate it with an obj file, loaded from disk. I have the file loaded as:
HelixToolkit.Wpf.SharpDX.MeshGeometry3D
But how can I spawn an array and dynamically change the transforms?
Upvotes: 0
Views: 64