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

Question about the FPS calculation

Anonymous 10 years ago 0
This discussion was imported from CodePlex

Elemental wrote at 2011-12-12 08:10:

I am running the CameraControlDemo and have activated the FPS counter. The FPS stays around 55FPS when I do nothing. When I rotate via mouse, it rises to about 110-120FPS. When I rotate via keyboard, it goes down to about 40FPS.

My question is:

Why do FPS rise when rotating via mouse, but go down when rotating via keyboard?

 

Best Regards

Bernd


objo wrote at 2011-12-12 20:40:

hi Bernd, the fps counter is counting frames by the CompositionTarget.Rendering event, which should fire at around 60Hz when the model is not too big. I think the mouse events have higher frequency and will force more frequent updates of the model, but I have not investigated how this works. I don't know why it goes down when using the keyboard, could it have something to do with the keyboard repetition rate?

http://msdn.microsoft.com/en-us/library/system.windows.media.compositiontarget.rendering.aspx 


Elemental wrote at 2011-12-13 08:33:

The background of my question is that FPS calculation seems to be wrong for larger objects.

When I have objects with like 200 000 triangles, the FPS when rotating via keyboard is like 5 FPS.

The FPS when rotating via mouse is like 80 FPS. The 80 FPS cannot be true, because it does not look smooth anymore.

 

I was just wondering why there is this difference in FPS calculation, but it is not really a problem...

 

Best Regards

Bernd


objo wrote at 2011-12-13 18:42:

Right, using the CompositionTarget.Rendering event is probably not an accurate method of calculate the frame rate.

Let us know if you find a better way to achieve this! (is there some other event in the WPF3D render loop that could be used?)

0

get normal associated to point

Anonymous 10 years ago 0
This discussion was imported from CodePlex

lioneloddo wrote at 2014-03-30 14:07:

I was wondering how it would be possible to get the normal associated to point determined such as in the FlightsDemo. In this demo, a method called "findnearestpoint" is used.
I don't know how this method works, but it would be very useful (at least for me) to know the normal at this point.

Thank you in advance for help.

objo wrote at 2014-04-29 10:37:

The Viewport3D.FindHits extension method in this library returns HitResults that contains normal vectors!
0

kinect integration

Anonymous 10 years ago 0
This discussion was imported from CodePlex

sandualbu wrote at 2011-12-15 22:36:

This is a really cool project, i like it. I'm thinking about integration with kinect SDK.  Wouldn't it be nice to zoom in/out and rotate objects using only hands movement?


objo wrote at 2011-12-19 09:16:

Yes, a demo using the Kinect SDK would be very interesting! Are you only thinking manipulating objects or also manipulating the camera? Which gestures could be used? Do you have links to some good kinect demos of 3D interaction?


sandualbu wrote at 2011-12-19 14:22:

i'm thinking about both..camera and object rotation... you can take a look at kinesis project. it performs zooming/scrolling and chart rotation (not on 3d objects, of course, but the idea can be developed more). Kinesis works with menus, but something which combine several movements can be built for manipulating 3d objects.

you can perform the rotatation operation as a real time rendering, depending on distance / elevation between hands, and not composed from multiple oprations (up/down/right/left), like kinesis is doing.

The most significant aspect i can think now, is to make kinect interaction as a kind of plugin, and not make helix dependent of it.


objo wrote at 2011-12-19 14:35:

Have a look at the SpaceNavigator implementation. Maybe the Kinect implementation can be done in a similar way (I don't think it should be handled as mouse/touch events).

I agree, a Kinect implementation should be in a separate assembly - suggesting the name HelixToolkit.Kinect.

I'll add the kinect sensor to my xmas wish list, so I can test this :)


sandualbu wrote at 2011-12-19 14:49:

is too hard what the space navigator is doing...I mean he wants to construct something....i think you want just to present 3dobjects, not build them with hands. I'm thinking more like what the guy is doing when presenting the universe with kinect (http://www.youtube.com/watch?v=GMZcz_tlGqw)



sandualbu wrote at 2011-12-22 07:49:

thta's just amazing. The only disadvantage is the red-cyan glasses. But the gestures used are pretty much like what I was thinking about your project. Of course, making the application render on 120hz display and a pair of active glasses will improve a lot the quality of image.


MrNikito wrote at 2013-09-12 17:33:

Hi, sorry for the question, but...

Where I could see th SpaceNavigator implementation?

Thanks

objo wrote at 2013-09-29 09:07:

You find the space navigator decorator in the HelixToolkit.Wpf.Input project and an example "Viewport features" in the example browser.
Tip: seach for "spacenavigator" in the solution and you will find all usages.
0

Setting material property to a jpeg does not work

Anonymous 10 years ago 0
This discussion was imported from CodePlex

jeeva_sjce wrote at 2013-09-03 06:12:

Hi, I am using the earth demo to wrap a jpg/png image to a pipe3d but it just does not seem to work. I have also tried using the ImageMaterial property within the xaml but it does not work too. Any help will be appreciated.

Thanks,
Jeevan

objo wrote at 2013-09-05 07:56:

Is the pipe including texture coordinates?

jeeva_sjce wrote at 2013-09-06 11:50:

How do we set the texture coordinates?

jeeva_sjce wrote at 2013-09-30 10:20:

I was able to solve this problem by using the 3DToolsTEXT from codeplex api to generate the texture coordinates for a cylinder. One thing that I experienced is larger azimuths the image was distorted. Any particular reason for this?

But, I must say this piece of software is mind blowing with the kind of capabiliites is has on offer! Kudos to you for such a fine job. :)
0

Loading big 3d file(.3ds)

Anonymous 10 years ago 0
This discussion was imported from CodePlex

starcrm wrote at 2012-07-27 14:43:

Hello, After Loading large 3d file(.3ds),when rotational model is too slow, what is a good way to improve?let rotating faster


objo wrote at 2012-08-09 00:53:

Reduce the level-of-detail? Sorry, it is not implemented in this library. 

0

Modelling

Anonymous 10 years ago 0
This discussion was imported from CodePlex

elkhalafy wrote at 2014-02-22 11:58:

Hello!

Guys,after sharpdx forked, Is there simple project about 3D modelling or editing on primitives ???

thanks, ..
0

Remove X Direction Grid Lines

Alex 9 years ago updated by ไอยดา สุรีวงค์ 3 years ago 1
I am using the Helixtoolkit NuGet package in my Visual Studio C# program and it's working well. I am generating a grid with grid = new GridLinesVisual3D(); but I do not want the grid lines that go in the X Direction, I would like to have grid lines in only the Y Direction. I have looked a the GridLinesVisual3D.cs file and I know exactly what needs to be changed, but I don't know how to change it. Because I am loading in the entire package to Visual Studio, I can't see the individual source files in the program to edit them.

So my question is, what is the best way to go about removing the lines in the X direction.

Thanks.
0

Draw to texture

Дмитрий Вавилов 9 years ago updated by Asdf Fdsa 2 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