This is the discussion forum for Helix Toolkit.
For bugs and new features, use the issue tracker located at GitHub.
Also try the chat room!
0

Draw to texture

Дмитрий Вавилов 10 years ago updated by Asdf Fdsa 3 years ago 1
Hello everyone.

Basic WPF 3D allows to draw to texture in runtime, using RenderTargetBitmap in material. So, drawing in this bitmap instantly affects on mesh texture.
In Helix Toolkit the visible texture changes only after re-attaching model, or using AttachMaterial() in MaterialGeometryModel3D. But these actions finally use something like this "...DiffuseMap.ToByteArray()", and it totally wastes speed of execution;


Is there some way to overcome this and/or bind Bitmap (or it's pure byte[]) to DiffuseMap?
Or Helix Toolkit have fast method to chenge texture?
Thanks!
0

I need zoom factor instead of mm

Anonymous 10 years ago 0
This discussion was imported from CodePlex

behnam263 wrote at 2014-08-16 07:43:

if i zoom with scroll or other keys position of camera will change which is linear changing
I need zoom factor is there any built in zoom factor or something which i can use?
there is some explanation about zoom factor and zoom in mm in this link:
http://chrisjones.id.au/FOV/fovtext.htm

objo wrote at 2014-08-18 13:22:

This is an interesting idea. Do I understand correctly - zooming should be done linearly in angle of view (fov) or focal length?
I have added the feature in the issue tracker: https://helixtoolkit.codeplex.com/workitem/10068

behnam263 wrote at 2014-08-20 18:00:

Yep
0

cutting mesh

Anonymous 10 years ago 0
This discussion was imported from CodePlex

edui wrote at 2013-03-05 07:20:

Hi All;

I'm very new in wpf and helix3d.
I have a 3d mesh model. The center of model positioned at Point3D(0,0,0). I want to cut the mesh which all vertices in positif Y axis.
  foreach (GeometryModel3D gm in mg.Children)
        {
            MeshGeometry3D mesh = (MeshGeometry3D)gm.Geometry;
            Point3DCollection positions = mesh.Positions;
            Vector3DCollection normals = mesh.Normals;
            Int32Collection indices = mesh.TriangleIndices;

            Point3DCollection newPositions = new Point3DCollection() ;
            Vector3DCollection newNormals = new Vector3DCollection();
            Int32Collection newIndices = new Int32Collection();
            int c = 0;
            foreach (Point3D p in positions)
            {
                if (p.Y >= 0)
                {
                    newPositions.Add(p);
                    newNormals.Add(normals.ElementAt(c)); //I'm not sure in this line
                    newIndices.Add(indices.ElementAt(c));
                }
                c++;
            }

            GeometryModel3D gd = new GeometryModel3D();
            MeshGeometry3D g = new MeshGeometry3D();
            g.Positions = newPositions;
            g.Normals = newNormals;
            g.TriangleIndices = newIndices;
            gd.Geometry = g;
            gd.Material = MaterialHelper.CreateMaterial(Colors.Aquamarine);
            nm.Children.Add(gd);
            nm.Transform = new TranslateTransform3D(new Vector3D(d.Bounds.X, d.Bounds.Y, d.Bounds.Z)); //translate to another positioned
        }
        ModelVisual3D v = new ModelVisual3D();
        v.Content = nm;
But i got the broken mesh. Any suggestions/ideas ?

Best Regards;
DM

edui wrote at 2013-03-21 10:29:

Hi All;

I found the solution.
        var n = new Vector3D(0,0.2,1);
        var p = new Point3D(0, 0.5, 0);

            var geo = MeshGeometryHelper.Cut(mesh, p, n);
            var m = new GeometryModel3D(geo, gm.Material);
            m.BackMaterial = Materials.Red;
        var mv = new ModelVisual3D();
        mv.Content = m;
        view1.Children.Add(mv);
But i've another problem. When I added the manipulator (CombinedManipulator) to the ModelVisual3D object.
After rotating the mesh, I want to cut the mesh. But the cut direction still follow the mesh direction, not the viewport direction.

Any idea?

edui wrote at 2013-03-25 08:45:

Hi All;

to precisely cut the mesh, i need to convert the model coordinate to global coordinate.

Regards;
DM
0

Move all adorners during a Manipulator

Anonymous 10 years ago 0
This discussion was imported from CodePlex

gmgunderground wrote at 2014-05-16 12:02:

Ho can I move all Manipulators adorner (by code C#) when for example I move X TranslatorManipulator? The code is working correctly because I can rotate and translate object, but adorners are fixed in the starting position.

My translator is
            translateManipulatorX.TargetTransform = mv.Content.Transform;
            translateManipulatorX.UnBind();
            translateManipulatorX.Bind(mv);
            translateManipulatorX.Length = Math.Max(mv.Content.Bounds.SizeX, Math.Max(mv.Content.Bounds.SizeY, mv.Content.Bounds.SizeZ)) * 1.2;
            translateManipulatorX.Offset = new Vector3D(mv.Content.Bounds.X + mv.Content.Bounds.SizeX, mv.Content.Bounds.Y + mv.Content.Bounds.SizeY / 2, mv.Content.Bounds.Z + mv.Content.Bounds.SizeZ / 2);
            translateManipulatorX.Visibility = System.Windows.Visibility.Visible;
If I remove offset all is working, but adorners are not correctly centered

Best regards
0

How to create a thick cone

Anonymous 10 years ago 0
This discussion was imported from CodePlex

chinh_nguyen wrote at 2013-01-09 13:27:

Hi, how can I create a thick cone using the library, if I use the AddCone method without cap, it is too thin that in some angle, the cone disappear.


chinh_nguyen wrote at 2013-01-10 08:45:

Hi all, I achieved the disappear problem by setting BackMaterial properties. It is not a thick cone yet but solve my problem. 

0

ObjImporter smoothing issue

Anonymous 10 years ago 0
This discussion was imported from CodePlex

powst wrote at 2014-08-07 16:30:

Hi there!
Thanks objo a lot for your great tools!

Doesn't anybody know what can be a problem for smoothing in Helix 3D Toolkit? I have a little bit strange case.. I got an .obj file with complex 3d-model which I want to be smooth. There are 2 "s on" lines in this file. I don't remember exactly but there was some issue while smoothng - and I set currentSmoothingGroup in ObjReader always to be 1.. And that helped, part of the 3d-object is now smooth. But only part.. For example I have a 3d-model of jaw - some teeth are smooth, some - very rough - there is clear difference. Using other 3d-viewers I can see all of the teeth are smooth.

In this file there are 2 "s on" lines - one before all vertices part, another one before faces. Plus there are a lot of separated "groups" (part of vertices or faces that start with "g"). I don't know maybe that is the problem - but groups with the same names are separated all over the file - ie that can be:
g Name1
...
g Name2
...
g Name1


I also tried to change some code in ObjReader - for example in AddGroup method in the beginning I put a line
if (Groups.Any(x => x.Name == name)) { return; }
And it partially helped - all teeth were smooth, but mesh in general was a little bit broken.. Than I changed smoothingGroupMap first parametr to be not int but the name of the group - for every group to have its own smoothing map (cause in original code after adding a group smoothing maps were destroyed) - but it made everything even worse. :(

Has anybody any ideas why there can be part of 3d-model smooth, and part of it - absolutely rough?

objo wrote at 2014-08-08 12:41:

Does it look correct in other software? (try meshlab)
I guess there could be a bug in the obj importer. In that case we should have a small test file and create an issue on this!

powst wrote at 2014-08-08 14:25:

Yes, exactly, I tried Meshlab :) And there when I switch on "Smooth" - it becames smooth, all of the teeth.

I can send you this .obj file..

powst wrote at 2014-08-11 14:33:

This is how it looks:
Using HelixToolkit
Using MeshLab

I feel like there can be an issue with Groups...

powst wrote at 2014-08-11 15:16:

By the way, this is what happened after inserting
 if (Groups.Any(x => x.Name == name)) { return; } 
line in AddGroup method:
After

Close enough, but appeared some clearly visible trouble with a few tens triangles on a problem part of the model...

powst wrote at 2014-08-14 17:38:


objo wrote at 2014-08-18 13:10:

Thanks for providing the file! I have added the issue at https://helixtoolkit.codeplex.com/workitem/10067
0

windows 8.1

Francis Tyrone Pimenta 9 years ago 0

i'm am not a c# profession. how can i get a nuget package into a windows 8.1 Desktop Program?

i made a test wpf program and there i can use the helix 3d nuget package. whats the best way for me to solve this problem?


Thank you for your help.

0

using keys to move camera while in drag mode

Anonymous 10 years ago 0
This discussion was imported from CodePlex

mihaipruna wrote at 2014-08-11 20:30:

I should be able to move and rotate the camera with the keyboard at least even while doing drag-drop operations, is there a way to retain that functionality?
0

Order Indiependent Transparency

Terry Price 10 years ago updated by ไอยดา สุรีวงค์ 4 years ago 1
Hello,

Does Helix 3D support any form of OIT such as depth-peepling?

If not, are there any plans to implement it in the future? It would be hugely helpful for my applicaiton.

If not, is there any way that I can 'tack it on' to the existing framework?

Best Wishes,

-TJP
0

Point Cloud using Helix Toolkit

Anonymous 10 years ago 0
This discussion was imported from CodePlex

Luka1211 wrote at 2013-10-02 20:50:

Hello,

i am new to c# and WPF, and i am trying to use helix toolkit to represent a kinect depth image as a point cloud. i am trying to load Points3DCollection into PointsVisual3D as it is explained in the source for the pointsandlines example. It keeps returning the message that it cannot implicitly convert points3DCollection to pointsvisual3D. Is there an example just for creating point clouds or just points using the mentioned methods?

Thx

abuseukk wrote at 2013-12-25 18:54:

Hi,

I am also trying to create a point cloud for the human body using Kinect and Helix 3d. For now there is a sample in the examples directory which I think has some mistakes in converting depth to 3d mesh cordinates. I found this link useful :

Kinect Stackoverflow
using (DepthImageFrame depthFrame = e.OpenDepthImageFrame()) {
  DepthImagePixel[] depth = new DepthImagePixel[depthFrame.PixelDataLength];
  SkeletonPoint[] realPoints = new SkeletonPoint[depth.Length];

  depthFrame.CopyDepthImagePixelDataTo(depth);

  CoordinateMapper mapper = new CoordinateMapper(sensor);
  mapper.MapDepthFrameToSkeletonFrame(DEPTH_FORMAT, depth, realPoints);
}
If someone can help me with converting this cordinates into correct Point3d Cordinates :)

AnotherBor wrote at 2014-01-07 05:33:

Luka1121, PointsVisual3D has a Points property to which you should assign your collection of points.

Abuseukk, you should probably decide to use the depth data as one of the coords of the points. new Point3D(xcoord, ycoord, depth[i]) would spread the points in Z axis accordingly to their depth.