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

HelixViewport3D's camera commands -- XAML bindings possible?

Anonymous 12 years ago 0
This discussion was imported from CodePlex

RobPerkins wrote at 2012-10-02 04:51:

I've gotten myself lost again. 

Well, not that lost; my application is using the HelixViewPort3D, which of course comes with the ViewCube and key bindings for orienting views. That's working perfectly. 

Now I have other UI elements *around* the HelixViewPort3D in the same UserControl which I'd like to configure to send commands to the HelixViewPort3D's camera controller. I had thought to do this with three buttons formatted something like this: 

 

            <dxb:BarButtonItem Content="XZ Front View" Command="{x:Static h:CameraController.FrontViewCommand}" CommandTarget="{Binding ElementName=VP, Path=CameraController}" />
       
... where VP is the name of the HelixViewPort3D in the same UserControl. It's not working. The buttons register in design mode as if the binding is correct (that is, the UI appearance goes from disabled to enabled) but at runtime the buttons behave as though CanExecute is returning false!

I'm not sure how to proceed, or whether it's possible. The CameraController exposes a RoutedCommand named "FrontViewCommand" so I thought this syntax would work. 

Any ideas? 


RobPerkins wrote at 2012-10-02 05:14:

Never mind; exactly those XAML bindings work... if the focus is on the ViewPort. This is the only Viewport in the control, though, so I'm not sure why an automatic CanExecute isn't being routed through...

0

Need Scaling Help

Anonymous 12 years ago 0
This discussion was imported from CodePlex

matthewfrazier wrote at 2010-10-12 17:23:

I'm trying to create a simple tube which I can do fine using this wonderful toolkit.  What I'm having a problem with is perspective or scaling.  Using the given array list of xyz coordinates I draw my tube BUT I can't make it "look right" in my view. I tried dividing by 1000 but that obviously just keeps the same problem just on a smaller scale.  My issue is that my z coordinate is always going to be much larger than my xy.   I want to create a tubing path for my users to view so they can see the deviation of the tubing.  I can do this with a simple xyz scatter plot in winforms but I want to be able to have the 3D camera control in WPF to give the users more perspective.  Any ideas?

private void LoadArrayList()
        {
            _x = new ArrayList() { 0, 1.31, 2.71, 3.06, 3.48, 4.69, 6.8, 9.51, 12.37, 15.75, 19.65, 23.76, 30.21, 38.89, 47.77, 56.81, 69.86, 78.23, 86.62, 96.26, 107.4, 117.4, 125.63, 133.91, 142.02, 148.47, 152.32 };
            _y = new ArrayList() { 0, 4.76, 7.19, 6.56, 6.76, 8.31, 11.66, 16.48, 22.3, 29.07, 36.08, 43.1, 54.16, 69.78, 85.66, 101.81, 124.95, 140.06, 154.96, 169.97, 185.11, 198.52, 210.58, 222.8, 235.48, 245.87, 251.77 };
            _z = new ArrayList() { 0, -463.96, -775.94, -901.94, -964.94, -1027.91, -1091.78, -1155.54, -1217.2, -1279.74, -1342.23, -1404.7, -1497.83, -1622.55, -1747.23, -1872.88, -2060, -2184.81, -2309.64, -2434.37, -2558.96, -2683.84, -2808.99, -2934.12, -3059.22, -3161.49, -3221.08 };
        }

        private void BuildTube()
        {
            var pc = new Point3DCollection();
            for (int i = 0; i < (_x.Count); i++)
            {
                pc.Add(new Point3D((Convert.ToDouble(_x[i]) / 1000.00) * 5, (Convert.ToDouble(_y[i]) / 1000.00) * 5, (Convert.ToDouble(_z[i]) / 1000.00) * 5));
            }
            tube.Path = pc;
        }

objo wrote at 2010-10-13 08:09:

can you change only the scale of the z-coordinates?

  var _x = new List<double> { 0, 1.31, 2.71, 3.06, 3.48, 4.69, 6.8, 9.51, 12.37, 15.75, 19.65, 23.76, 30.21, 38.89, 47.77, 56.81, 69.86, 78.23, 86.62, 96.26, 107.4, 117.4, 125.63, 133.91, 142.02, 148.47, 152.32 };
  var _y = new List<double> { 0, 4.76, 7.19, 6.56, 6.76, 8.31, 11.66, 16.48, 22.3, 29.07, 36.08, 43.1, 54.16, 69.78, 85.66, 101.81, 124.95, 140.06, 154.96, 169.97, 185.11, 198.52, 210.58, 222.8, 235.48, 245.87, 251.77 };
  var _z = new List<double> { 0, -463.96, -775.94, -901.94, -964.94, -1027.91, -1091.78, -1155.54, -1217.2, -1279.74, -1342.23, -1404.7, -1497.83, -1622.55, -1747.23, -1872.88, -2060, -2184.81, -2309.64, -2434.37, -2558.96, -2683.84, -2808.99, -2934.12, -3059.22, -3161.49, -3221.08 };
        
  var pc = new Point3DCollection();
  for (int i = 0; i < (_x.Count); i++)
            {
                pc.Add(new Point3D(_x[i], _y[i], _z[i]*0.01));
            }
  tube.IsPathClosed = false;
  tube.Path = pc;
Note that you should interpolate your data to get a smooth tube where there are sharp bends - the tube code is currently only extruding a circle along the given data.  

0

Assembly not found

Anonymous 12 years ago 0
This discussion was imported from CodePlex

dcrysty23 wrote at 2014-08-12 12:45:

Helix 3D Toolkit library I downloaded and tried to use it in my project but I get this error.

"Assembly HelixToolkit.Wpf was not found"

"Assembly HelixToolkit.Wpf.Input was not found"

This is code xaml:
 xmlns:helix="clr-namespace:HelixToolkit.Wpf;assembly=HelixToolkit.Wpf"
 xmlns:helixInput="clr-namespace:HelixToolkit.Wpf.Input;assembly=HelixToolkit.Wpf.Input"
I put a picture to see that I added the anssembly

http://i60.tinypic.com/jp989k.jpg
0

Helix Toolkit with Kinect -Beginner

Anonymous 12 years ago 0
This discussion was imported from CodePlex

shaelyn wrote at 2014-02-28 14:40:


Click to view the photo
I opened the HelixToolkit.Kinect.sln and I didn't make any changes on the coding.
I got these errors when I built the solution. Any idea why is this happens?
0

HelixViewport3D rendersize change

Anonymous 12 years ago 0
This discussion was imported from CodePlex

iLovePasta wrote at 2013-01-20 10:34:

Hi,

is there any possibility to change dimensions of rendered *.jpg file from HelixViewport3D. It seems to me, that it adjusts dimensions of exported image according to current ViewPort size. But I'm not able to change these via none of it' properties like Width, RenderWidth, even a ScaleTransform does not seem to make things happen.

Do You know how is possible to change export sizes? Typical use case - I want to export in, say, 800x600 & 1024#768 resolution etc.

Thanks.

 

edit: It looks like I'm spamming here:), but it's my second post & again...after trying to resolve the problem like for an hour or so, I wrote here & suddenly after few minutes, I figured out how to do this.

 

If somebody is interested in future - You have to access HelixViewport3D's property ViewPort, where You shold define rendersize property.


objo wrote at 2013-01-23 20:32:

Thanks for posting the solution to your problem.

I think the Viewport3DHelper.RenderBitmap method should be overloaded with a method where you can specify the width and height.

Did you also notice the "oversampling" multiplier feature in that method? It is good for software rendering!

0

getting bounds of viewport...

Anonymous 12 years ago updated by ไอยดา สุรีวงค์ 5 years ago 1
This discussion was imported from CodePlex

NMorgan wrote at 2011-08-22 16:45:

I was wondering how I could get the cordinate bounds that are being displayed in a viewport?  For instance the top left corner is (-100,100) and the bottom left corner is (100,-100).


objo wrote at 2011-08-22 20:37:

hi NMorgan, I don't quite understand what coordinates you need. Do you need the actual client rectangle of the HelixView control? Did you try

new Rect(VisualOffset.X, VisualOffset.Y, ActualWidth, ActualHeight);

(Temporarily arranging a control to VisualOffset=(0,0) helped me out in another project when I was rendering to a RenderTargetBitmap..)

If you need to project 3D coordinates on the 2D view, see the Helpers/ViewPort3DHelper class.


NMorgan wrote at 2011-08-23 14:49:

Hello, thanks for the reponse what I am looking for a rectangle (or just the coordinates of the points) that represents the area being displayed by the viewport. 


objo wrote at 2011-08-23 15:48:

Still do not understand. The HelixView control displays a 3D frustum (when using a ProjectionCamera).


NMorgan wrote at 2011-08-23 15:50:

I am using a orthographic camera not a projection. Basicly if I wanted to draw a point at the upper right hand corner of the viewpoint how would I go about getting the coordinates of that point.


objo wrote at 2011-08-23 20:24:

try

HelixToolkit.Viewport3DHelper.Point2DtoRay3D(yourViewport, new Point(yourViewport.ActualWidth,0))

I have not tested it, but I think this will work with an orthographic camera. Note that this will give you a ray, you can use the Point2DtoPoint3D method if you want a point at the near or far clip plane.
Petzold's 3D programming book could also be a good source for more solutions to this!  

0

import .max to Helix 3D Toolkit

Anonymous 12 years ago 0
This discussion was imported from CodePlex

francolico88 wrote at 2013-04-04 17:06:

Hello, as you can import models .max____? is compatible?
It is for an application I'm doing with KINECT SDK 1.7 with C# in Visual Studio 2012. I want to include in the Implementation of SkeletonPainter3D these models.
Help friends!

objo wrote at 2013-04-15 12:12:

Sorry, this toolkit cannot import .max models, but it has partial support for .3ds models!
0

Using Rotate Manipulator

Anonymous 12 years ago 0
This discussion was imported from CodePlex

ftp25 wrote at 2013-05-30 14:11:

Hi,
wanted to use a RotateManipulator in my application to rotate a Model (CubeVisual3D) all the time.

Now my problem is that I can see in Task-Manager that the memory usage of my application is always increasing as long as the cube is rotating.

Is this normal behaviour or am I missing something here?

Would be glad for any advice how to solve this problem.

objo wrote at 2013-06-08 07:20:

Can you try to run a memory profiler on your application to check whether there is an error in this library or in your application?
The RotateManipulator should just modify the transform of the cube, I don't expect a memory leak here.

ftp25 wrote at 2013-06-16 21:47:

I have spent now lot of time for finding the poblem causing the memory leak.
Now I know that the problem is not the rotate manipulator.
Everytime I'm using basic transformation like this with helixtoolkit
var g = new Transform3DGroup();
g.Children.Add(rotateTransform);
the problem is occuring.

I don't see the problem if I'm defining the rotation transformation in xaml like that:
                     <Transform3DGroup>
                            <RotateTransform3D>
                                <RotateTransform3D.Rotation>
                                    <AxisAngleRotation3D Axis="0,1,0" Angle="{Binding RotationAngle}"/>
                                </RotateTransform3D.Rotation>
                            </RotateTransform3D>
                        </Transform3DGroup>
I don't know why but it is like that.
Think I have to find a workaround for my problem.

Anyway, thanks for the great helixtoolkit!

BR
ftp25

Ranik wrote at 2014-04-15 12:20:

I am having the same issue as ftp25.
When I perform any camera gesture (zoom/rotate/pan) the amount of memory used by the application jumps by ~450MB.
I ran ANTS memory profiler on the application and it showed that all these extra memory is categorized under "Unmanagad Memory" and no further details where given by the profiler regarding this.
What could be the issue and what should I investigate?

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

I guess this is due to how WPF works internallly. Please let us know if you find any issues. Is the memory released later? It does not continue to increase, right?
0

Helix Controls

Anonymous 12 years ago 0
This discussion was imported from CodePlex

alexalthauser wrote at 2012-02-19 00:21:

Hi,

Are the Helix controls meant to show in the toolbox? Mine do not. If they are, which I kind of doubt, but if they are, can somebody plz give me a point in the right direction? I thought they might, since they are referred to as 'custom controls', but I could be mistaken. Either way, it's a really great library.

Thanks!


objo wrote at 2012-02-21 20:45:

are you auto populating the toolbox items? http://karlshifflett.wordpress.com/2009/10/27/new-options-for-visual-studio-2010-beta2-wpf-and-silverlight-projects/

I think it is also possible to right click in the toolbox and "choose items...", but I have not tried myself. All HelixToolkit.Wpf controls are showing up in the toolbox when I open the HelixToolkit solution here.

0

How to set cameras target point

Anonymous 12 years ago updated by manypage 3 years ago 4
This discussion was imported from CodePlex

Rahvil wrote at 2011-09-07 12:13:

Hi again,

Is it possible to set the cameras target point from code. I found target point property from HelixView3D.CameraController.CameraTarget but it's read only. So basically what I would like to achieve from code is the same as double right clicking the model.

Thanks for the help in advance.


objo wrote at 2011-09-07 21:24:

Do you want to change the camera position or the look direction? I think that was the reason I did not add a setter.We could add a setter that changes one of these properties. Also notice that the CameraTarget is a plain property, not a bindable dependency property.


Rahvil wrote at 2011-09-12 10:08:

Thanks for the reply.

I achieved to do what I needed by changing camera position and look direction.