I have made a ply file with the help of this wrapper.
How I made the ply file is shown below:
using (var frames = pipeline.WaitForFrames())
{
var colorFrame = frames.ColorFrame.DisposeWith(frames);
var depthFrame = frames.DepthFrame.DisposeWith(frames);
var points = pc.Process(depthFrame).As<Points>();
// We colorize the depth frame for visualization purposes
var colorizedDepth = colorizer.Process<VideoFrame>(depthFrame).DisposeWith(frames);
// CopyVertices is extensible, any of these will do:
var vertices = new float[points.Count * 3];
// var vertices = new Intel.RealSense.Math.Vertex[points.Count];
// var vertices = new UnityEngine.Vector3[points.Count];
// var vertices = new System.Numerics.Vector3[points.Count]; // SIMD
// var vertices = new GlmSharp.vec3[points.Count];
// var vertices = new byte[points.Count * 3 * sizeof(float)];
points.CopyVertices(vertices);
points.ExportToPLY("pointcloud.ply", colorFrame);
// Render the frames.
cloudPoints = importer.Load(@"pointcloud.ply");
}
Now I want to display it using the code:
private void Create3DViewPort()
{
var hVp3D = new HelixViewport3D();
var lights = new DefaultLights();
HViewPort.Children.Add(lights);
HViewPort.Children.Add(cloudPoints);
this.AddChild(HViewPort);
}
But I get the error at the line HViewPort.Children.Add(cloudPoints);
. It is saying that:
It cannot convert Systems.Windows.Media.Media3D.Model3D to Systems.Windows.Media.Media3D.Visual3D.
Can someone help me how I can display the point cloud using the helix toolkit?