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

PieSliceVisual3D not shown in ViewCubeVisual3D

Anonymous 4 years ago 0
This discussion was imported from CodePlex

Elemental wrote at 2011-11-11 14:05:

Hello,

I have version 72068 and there seems to be a problem with the ViewCube.

The cube is shown, but the PieSliceVisual under the cube not.

 

Is this a bug?

 

Best Regards

 


objo wrote at 2011-11-12 00:08:

You are right, I had introduced a bug when refactoring the base class. Should be corrected now!

thanks!

0

BoundingBoxVisual3D Performance Issues

Anonymous 4 years ago 0
This discussion was imported from CodePlex

Nomad101 wrote at 2012-09-27 05:46:

So I just started using the Helix toolkit and honestly it is amazing and has made my life a lot easier. However I noticed a fairly significant performance slow down using the BoundingBoxVisual3D type. I did a test using the CubeVisual3D and the BoundingBoxVisual3D with ten of each dynamically moving as well as a dynamic camera look direction. The test yielded a massive change in performance between the two types. I was thinking of a way around this and was wondering if anyone had any thoughts on what I was thinking. 

Since the BoundingBox uses A set of lines to make a cube it has a good amount of overhead for each object. What if instead it used a custom Gradient Brush that went from a colored outline to a transparent center. I Think this could work out fairly well Let me know what you think.

The only drawback is you would need to individually paint each face, but could still easily be less overhead than the 12 lines per BoundingBox. 

0

Default zoom

Anonymous 4 years ago 0
This discussion was imported from CodePlex

udaykm1986 wrote at 2013-09-17 15:21:

During control load event, the property ZoomExtentsWhenLoaded="True" is used for setting default zoom and makes HelixViewport3D content fit to it. If we need to handle zoom even before control is loaded then how to set zoom value?

objo wrote at 2013-09-25 09:01:

You can set the properties of the camera before the control is loaded. You cannot use any of the zoom commands that relate to the size of the view before the control is loaded.
0

LinesVisual3D performance question

Anonymous 4 years ago 0
This discussion was imported from CodePlex

peterthesaint wrote at 2014-08-22 15:57:

Hello !!!

Previously in my model I was using ScreenLinesVisual3d.
Now I noticed new Helix version allows LinesVisual3d and I was wondering whether you have implemented changes suggested in this link:
http://www.ericsink.com/wpf3d/1_ScreenSpaceLines3D_Performance.html

I am asking this because I still see a big impact on performance.

Regards,
Peter

objo wrote at 2014-08-22 21:54:

LinesVisual3D is only updating the geometry when the view/projection transforms are changed. This should handle the performace issue that Eric Sink is pointing at.

I did some profiling when I created the LinesVisual3D, but there are probably improvement possibilities! There is a demo application where you can compare the performance with the 3DTools and Petzold.Media3D implementations. I see AB4D also has an implementation of 3D lines, has anyone compared the performance with this?
0

OBJ Importer making far more groups than expected.

Anonymous 4 years ago 0
This discussion was imported from CodePlex

Rogad wrote at 2014-01-28 16:31:

So I am working on my full body model and trying to identify the different groups in the model.

Objo, this is the same model I am using that I emailed you recently.

When I load the model into UVMapper it shows that there are 63 groups in the model which was exported from Daz Studio...

Image

All well and good. But when I import into WPF with Helix, suddenly I have 2146 children in the model. I thought a group would be a child and was only expecting 56 children (from 0 to 55 indexed).

Here's a bit of code. This function (after loading the model) iterates over all the children in the model, which I was expecting to be the 56 groups... this is to help me identify the groups/children in the model. The texture of a group/child defaults to green.

To identify a particular child visually I pick out the index and colour it red.

But as said there are 2146 children and it's not workable. I am seeing minute parts of the model in red, rather than a whole group/child.

Am I doing something wrong or is there a bug in the importer please ?
 public Material greenMaterial = MaterialHelper.CreateMaterial(Colors.Green);
        public Material redMaterial = MaterialHelper.CreateMaterial(Colors.Red);

        public Model3DGroup neutralModel = new Model3DGroup();

        public void makeNeutralReferenceModel()
        {
            var index = 0;

            foreach (var m in neutral.Children)
            {
                GeometryModel3D geo = (GeometryModel3D)m;
                MeshGeometry3D mes = (MeshGeometry3D)geo.Geometry;

                if (index == 1)
                {
                    neutralModel.Children.Add(new GeometryModel3D { Geometry = mes, Material = redMaterial });
                }
                else
                {
                    neutralModel.Children.Add(new GeometryModel3D { Geometry = mes, Material = greenMaterial });
                }
                index++;
            }

            scene.Content = neutralModel;

            temp.Text = neutral.Children.Count.ToString();
        }

objo wrote at 2014-02-02 11:57:

Can a group contain meshes with different materials?
In that case it is possible that the importer adds a new model for each mesh. The output model could be changed to a hierarchy, where the first level correspond to the groups. I think this can be added as an issue! A small example model and a failing unit test included in the issue would be awesome! :)

Rogad wrote at 2014-02-02 16:48:

Can a group contain meshes with different materials?
I do not know the answer to that, I'll see if I can find anything.
The output model could be changed to a hierarchy, where the first level correspond to the groups.
Do you mean that as something you would need to do in the importer or something I can do in code ?
I think this can be added as an issue! A small example model and a failing unit test included in the issue would be awesome!
I'm happy to help in any way I can but I do not really know what a "failing test unit" is' !

Every other model I have used so far (not many really though) have been fine. The head I was working on came from a different program, I think from FaceGen. But as mentioned above this full body one comes from Daz Studio, but it looks fine in UVMapper.

You will have the model in your email if that's any use (daz-working-model.zip).

Thanks for taking a look :)

Rogad wrote at 2014-02-02 23:07:

Hi again,

In an effort to find out about the question over groups and meshes I asked a question over on Stackoverflow.

Here is a link to it for your reference : http://stackoverflow.com/questions/21517489/obj-3d-model-can-a-group-contain-meshes-with-different-materials

Rogad wrote at 2014-02-04 15:13:

Can a group contain meshes with different materials? In that case it is possible that the importer adds a new model for each mesh. The output model could be changed to a hierarchy, where the first level correspond to the groups.
Thinking some more about this. There are 26 materials. Some groups would seem to refer to the same material. Like the eyes for example. So you have two eye groups and both point to the same material. I don't think there are any sub meshes within a group like you ask. At least I don't think there should be ?

I can see no reason why a mesh is being dissected like the way it is, just by looking at the model. The importer appears to be subdividing the groups, if it is finding the groups at all.

Making a hierarchy might help, but why not just identify the groups anyway and build those individually so you have the right number of children/groups in the end ?

If it were a hierarchy one would still need to apply textures and modify the mesh - would that be possible with a hierarchy ? Which makes me think simply going for groups is the key here.

Personally I do not need to control the minute parts of the mesh - I don't know if that would be useful to anyone else though.

Rogad wrote at 2014-02-04 18:01:

Well I have been looking at the model files produced by Daz Studio and I think I have been going up the wrong path.

I now do not think it is the fault of the OBJ Importer :)

After examining the different export options in Daz Studio, it seems the one I was using is making all these groups. For example in the OBJ file for the body model I used a text editor to count the occurrences of the left toe and there are 248 matches, each time declared as a group and assigned a material.

So that's what is going on. I had thought that groups would be the major parts of the model, and after seeing what UVMapper displays I thought it even more. I clearly do not know enough about the OBJ format !

I found I could export from Daz using the materials as groups. Once I had done this I have what I want - a model with groups of major body parts.

I still feel confused by what UVMapper was telling me though. Like why was it reporting only 63 groups ? I have no idea.

My guess is that the models have so many groups so that each part of the body can be morphed/reshaped. So I was wrong in thinking that for example the head would be one group - I was actually exporting a lot more information than that. Information that I don't think I need.

So Oystein it looks like that is settled, sorry for taking things so far off course - I think you can now close the issue I opened regarding this matter. :)

objo wrote at 2014-02-04 18:28:

ok, I am glad you found out what was going wrong. I have closed the issue!
0

How to offset/translate a Point in PointsVisual3D

Anonymous 4 years ago 0
This discussion was imported from CodePlex

pyrrhicpk wrote at 2012-11-06 07:29:

Hi,

I am drawing two points in the helixviewport3d using the following code. How can I offset/translate the points to new positions?

var result = new Point3DCollection(n);

var pt1 = new Point3D(0, 0, 0);
var pt2 = new Point3D(5, 5, 5);

result.Add(pt1);
result.Add(pt2);  

VisualPoints = new PointsVisual3D();
VisualPoints.Points = result;


myhelixviewport3d.Children.Add(VisualPoints);


pyrrhicpk wrote at 2012-11-07 03:58:

Actually, I want to translate the two points to different locations. Applying translate transform to the VisualPoints would result in the translation of both the points to the same new location. Am I right in this?

Actually, I have about 300,000 points in "result" and I want to translate each point to a new position. I tried doing result[0].Offset(xnew,ynew,znew); but I found that the offset applies on a copy and not on the original point. So, other possible way is to replace all the points in "result" with new points (with new positions). Are there any other workarounds?

0

capping extrusions?

Anonymous 4 years ago 0
This discussion was imported from CodePlex

mihaipruna wrote at 2014-08-24 19:36:

Hi, this is the code I am using to create an extrusion. I'd like to cap the ends so it looks solid.
    ExtrudedVisual3D extru = new ExtrudedVisual3D();
                System.Windows.Media.PointCollection collpo = new PointCollection();
                foreach (Point popo in sketchy.points2dlist  )
                {
                    collpo.Add(popo); 
                }
                extru.Section = collpo;
                extru.SectionXAxis = xaxis;
                extru.Transform = groupo;
                extru.Material = new DiffuseMaterial(new SolidColorBrush(colo));
                extru.IsSectionClosed = true;
                 
                Point3DCollection collpa=new Point3DCollection();
               foreach (Point3D po3 in pupo.points3dlist)
                {
                    collpa.Add(po3);  
                }
                extru.Path = collpa;

  
                extru.Fill = new SolidColorBrush(colo);
0

GetTotalNumberOfTriangles NullPointerException

Anonymous 4 years ago 0
This discussion was imported from CodePlex

ddklo wrote at 2012-01-30 15:55:

Hi.

I some circumstances the Geometry or TriangleIndices property on our models is null which causes the GetTotalNumberOfTriangles to throw an NullPointerException. Could you add some null checks or catch the exception?

Regards Dagfinn


objo wrote at 2012-01-30 20:45:

added null checks - see 74458.

0

Loading large mesh or many model3d

Anonymous 4 years ago 0
This discussion was imported from CodePlex

behnam263 wrote at 2014-06-29 06:08:

HI
is there any thing like field of view for camera?
i mean loading meshes if camera look into them like "unity4"
and other meshes do not render when they are not in front of
camera? it is a big issue for controlling ram and cpu usage.

objo wrote at 2014-07-02 13:13:

Yes, see http://msdn.microsoft.com/en-us/library/system.windows.media.media3d.perspectivecamera.fieldofview(v=vs.110).aspx
Sorry, occlusion culling is not implemented in this library. I am not sure if this will work with the WPF 3D model, changing the visual model may be expensive!
0

Import a file with background worker

Anonymous 4 years ago 0
This discussion was imported from CodePlex

thiagoaguirre wrote at 2014-02-25 13:47:

Hi Objo!
Your library is amazing!

I couldn't import a model, with the ModelImporter, using a thread or task. It's cause a exception in Viewport3D.
While the thread is reading and the file size is too big, the main window not respond.
I think it is because the Model3DGroup is frozen.

I don't know as do that.
You can help me?

Thank you very much.
Thiago Aguirre Lorscheiter