コード例 #1
0
ファイル: NViewMatchVisualizer.cs プロジェクト: Ruodan/Gygax
        public static GeometryModel3D[] GetModels(NViewMatch nvm)
        {
            List<GeometryModel3D> models = new List<GeometryModel3D>();

            foreach (var cameraPosition in nvm.CameraPositions)
            {
                models.AddRange(GetCamera(cameraPosition));
            }

            if(nvm.Patches.Count <= 0)
                return models.ToArray();

            PointGeometryModel3D model = new PointGeometryModel3D();

            model.Color = Color.White;

            model.Geometry = Pointcloud.ConvertToPointGeometry3D(
                nvm.Patches.Select(patch => new PclWrapper.Points()
                {
                    x = patch.Position.X,
                    y = patch.Position.Y,
                    z = patch.Position.Z,
                    r = (byte)patch.Color.Red,
                    g = (byte)patch.Color.Green,
                    b = (byte)patch.Color.Blue,
                    a = 255
                }).ToArray());

            models.Add(model);

            return models.ToArray();
        }
コード例 #2
0
        public static GeometryModel3D[] GetModels(NViewMatch nvm)
        {
            var showCameras = true;

            var tg = new MatrixTransform3D(nvm.Transform);

            List <GeometryModel3D> models = new List <GeometryModel3D>();

            if (showCameras)
            {
                foreach (var cameraPosition in nvm.CameraPositions)
                {
                    var pos = GetCamera(cameraPosition);

                    foreach (var c in pos)
                    {
                        c.Transform = tg;
                        models.Add(c);
                    }
                }
            }

            if (nvm.Patches.Count <= 0)
            {
                return(models.ToArray());
            }

            PointGeometryModel3D model = new PointGeometryModel3D();

            model.Color = Color.White;

            model.Geometry = Pointcloud.ConvertToPointGeometry3D(
                nvm.Patches.Select(patch => new PclWrapper.Points
            {
                x = patch.Position.X,
                y = patch.Position.Y,
                z = patch.Position.Z,
                r = (byte)patch.Color.Red,
                g = (byte)patch.Color.Green,
                b = (byte)patch.Color.Blue,
                a = 255
            }).ToArray());

            models.Add(model);

            model.Transform = tg;

            return(models.ToArray());
        }