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

Adding/Showing Points

Anonymous 10 years ago 0
This discussion was imported from CodePlex

alexalthauser wrote at 2012-02-24 23:15:

Hi,

I'm working on a project where I need to show a series of vertices in 3d. I can't find any tutorials on how to hide/show lines and verts. I was wondering if Helix has anything that might help, or, if anyone knows of any examples that might be useful.


alexalthauser wrote at 2012-02-25 00:32:

Ah, never mind. I figured it out. =]


objo wrote at 2012-03-10 16:04:

Good. See the PointsAndLinesDemo and the latest bug fix.

0

Default Axis Arrows

Anonymous 10 years ago 0
This discussion was imported from CodePlex

RobPerkins wrote at 2012-09-04 23:07:

I'm still trying to sort out how Helix 3D arranges its axes by default. 

A HelixViewport3D can automatically display a coordinate system graphic which tracks with the camera by specifying this properties:

 <h:HelixViewport3D ShowCoordinateSystem="True" >

This displays three arrows, one each of red, green, and blue. 

The question is, which one corresponds to X, which to Y, and which to Z?

The reason for the question is related to the top view, which when clicked on by the view box displays the arrows as red increasing left, green increasing up, and blue increasing towards the camera. If this is an RHS, then the green corresponds to X. If it's an LHS, then it corresponds to Y. 

Thus, the operative other question becomes "how do I get the "top view" to rotate so that the X axis increases to the right of the screen, the Y axis increases to the top, and the Z axis points toward the camera?


objo wrote at 2012-09-04 23:17:

The red arrow has direction (1,0,0)
The green arrow has direction (0,1,0)
The blue arrow has direction (0,0,1) 


RobPerkins wrote at 2012-09-04 23:25:

objo wrote:

The red arrow has direction (1,0,0)
The green arrow has direction (0,1,0)
The blue arrow has direction (0,0,1) 

OK, that makes Helix's coordinate system a left handed system, with the "top U" view displaying X increasing left, Y increasing up, and Z increasing towards the camera, doesn't it? That is, a rotation proceeding from X=1 to Y=1 happens clockwise

Is there a convenient place to transform the coordinates so that you can get an RHS out of Helix, where the top view corresponds to my second question? 


RobPerkins wrote at 2012-09-05 00:49:

OK, I've done some more testing and it doesn't look like a problem with the coordinate system. 

I added this code to my viewport:

Private Sub VP_MouseMove(sender As Object, e As MouseEventArgs) Handles VP.MouseMove
  Dim q = Viewport3DHelper.FindHits(VP.Viewport, e.GetPosition(VP))
  If q.Count > 0 Then
    Coordinates.Text = q(0).Position.FormattedString
  End If
End Sub

 When in the "U" top view, tracking the mouse along my geometries shows X increasing to the right, and Y increasing up. 

However, while the axis display looks points correctly for Y and Z, it indicates X increasing to the left, which is false! The red arrow appears to have direction (-1,0,0), suggesting a transform in that viewport which is not accurate!

There is no problem with the coordinate system of the main viewport; it's RHS the way we discussed in another thread. It's the viewport onto the axis that I think needs attention. 


RobPerkins wrote at 2012-09-05 01:35:

OK, I've uploaded a small sample here:

 

http://db.tt/Y5vGU0hV

 

... to demonstrate what I mean. Position the running viewer in the "U" top view and run the mouse along the cube from left to right, observing the text below. The X coordinate increases to the right, but the red arrow points left! The Y coordinate increases up, with the green arrow pointing up, as it should, and a Front view shows that the blue arrow, indicating Z, points up with the Z coordinates increasing up.

That X coordinate arrow is inverted.  


RobPerkins wrote at 2012-09-05 01:44:

Found it.

In the project, the "Generic.xaml" file defined this XAML:

 

                            <Viewport3D x:Name="PART_CoordinateView" 
                                        Width="{TemplateBinding CoordinateSystemWidth}" Height="{TemplateBinding CoordinateSystemHeight}" Margin="0" 
                                        HorizontalAlignment="{TemplateBinding CoordinateSystemHorizontalPosition}" VerticalAlignment="{TemplateBinding CoordinateSystemVerticalPosition}" 
                                        ClipToBounds="False" Visibility="{TemplateBinding ShowCoordinateSystem, Converter={StaticResource BoolToVisibilityConverter}}">
                                <local:ArrowVisual3D Point2="-10 0 0" Fill="#964B4B" />
                                <local:ArrowVisual3D Point2="0 10 0" Fill="#4B964B" />
                                <local:ArrowVisual3D Point2="0 0 10" Fill="#4B4B96" />
                                <!--
                                <local:PieSliceVisual3D Normal="1,0,0" UpVector="0,0,1" InnerRadius="3" OuterRadius="6"  Fill="#80ff0000"/>
                                <local:PieSliceVisual3D Normal="0,1,0" UpVector="1,0,0" InnerRadius="3" OuterRadius="6"  Fill="#8000ff00"/>
                                <local:PieSliceVisual3D Normal="0,0,1" UpVector="0,1,0" InnerRadius="3" OuterRadius="6"  Fill="#800000ff"/>
-->
                            </Viewport3D>

The problem was in the vector defining Point2 for the X axis arrow:

                                <local:ArrowVisual3D Point2="-10 0 0" Fill="#964B4B" />

Changing the first value from -10 to 10 corrected the incorrect arrow direction. I don't know if this XAML is present in the current release bits of Helix as I found it in mine or if I twiddled it at one point in the past, since I'm using Helix source code in my project. Might be worth a check...

0

Need advice to apply dash style to screenspace visual3D's

Ashit 8 years ago updated by ไอยดา สุรีวงค์ 3 years ago 1

I want to apply dash styles to screenspace visual3D

0

Helix3D + WPF + SharpDX

Anonymous 10 years ago 0
This discussion was imported from CodePlex

luca82 wrote at 2013-04-09 11:56:

Hello!

A simple question...

I read that you are trying to use SharpDX with Helix3D... Does it mean that only the rendering engine will change, or we''l have to use classes other than Model3DGroup, Geometry3DGroup?

And it will embeddable inside WPF?

Thanks in advance for your answers

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

The SharpDX fork is under development and the goal is to have a similar model structure as WPF 3D. It can of course not use the WPF3D classes, and the geometry classes will also be based on SharpDX structures for performance reasons.

Yes, it is embeddable in WPF (using D3DImage). See the demos!

luca82 wrote at 2013-04-15 14:08:

Thank you very much!

I'll look forward to it :D

very very good news :D

cedrelo wrote at 2013-04-16 08:35:

Hi,


Where are the demos ?


Cedre

luca82 wrote at 2013-04-16 12:53:

They are in the sharpdx fork, but I cannot compile them :(
0

Accessing 3d elements in XAML binding/code-behind...

Anonymous 10 years ago 0
This discussion was imported from CodePlex

BogusException wrote at 2014-07-02 20:23:

This looks really promising! I have a simple, simple project:

-Create a globe of earth, with countries that can be bound & animated in code-behind.

It really is that simple. i can buy a 3d model of earth in all kinds of formats, but I have no clue which format(s) will allow me to (after conversion to XAML), say, turn England bright green, or make the USA blue, etc. in normal animation...

What file format(s) and conversions are possible to allow accessing/binding each individual (country, in this case) element with XAML/WPF?

I have 3ds max experience (don't run it any more), so I understand the concept of multiple objects, and there are many models available that have this structure.

Your feedback appreciated! TIA!

pat
:)

objo wrote at 2014-07-11 21:52:

I would try using an SVG file, triangulate the country polygons, transform from 2D lat/lon to a 3D mesh on a sphere.
For SVG maps, see wikipedia or http://kartograph.org/
0
Under review

How to limit rotation

Anonymous 10 years ago updated by Øystein Bjørke 10 years ago 2
This discussion was imported from CodePlex

ejleigh wrote at 2012-06-12 03:28:

I have a terrain model with objects on top and I'm trying to find a good way to prevent the user from rotaing the scene such that he can look underneath the terrrain model. It seemed like the best way would be to derive a new class from CameraController and override the OnManipulationDelta method, but unfortunately you cannot set the camera contoller in the HelixViewPort3D. At the moment I'm setting the RotationSensitivity to a low value when the camera Up vector approaches level, but that only kindof works. It's not ideal. Is there a better way?

 


objo wrote at 2012-06-15 06:38:

The CameraController is created in the control template of the HelixViewport3D, so you have to override the control template. http://wpftutorial.net/templates.html

Or, use the Camera's Position and LookDirection coerce value callbacks, and enforce the Z values to to be positive and negative, respectively.

http://msdn.microsoft.com/en-us/library/ms754209.aspx
http://msdn.microsoft.com/en-us/library/system.windows.coercevaluecallback.aspx

I have not tried this, but I think it should work.


lightxx wrote at 2013-02-26 10:11:

objo, could you please provide a simple example on how to do this? I guess limiting the rotation is quite a frequent requirement.
thank you very much!

objo wrote at 2013-03-13 07:12:

0
Under review

How do I display pipe properties?

Mark4965 8 years ago updated by anonymous 4 years ago 3

Good Afternoon,


First off, I've really enjoyed using Helix and as a new user of WPF and graphical programming, I have found Helix very easy to use as well a aid during my learning process. The work put into this project is much appreciated!


I am currently working on a program where the user can create various elements (pipes, spheres, etc.) by inputting the appropriate inputs and graphically display them in the viewport.


Up to now everything has been pretty straight forward. Where I've been hung up the last several days is how to display the properties of the elements once selected with the mouse. For example, if user creates a pipe and then selects it a window would display the diameter, inner diameter, and Point1/2 coordinates. From what I can tell the BuildingDemo might provide a good example as to how this is accomplished however the PropertyGrid remains blank when I select something.


If anyone could provide some insight or some example code I would be extremely grateful. If you need more information please let me know.

0

Middle mouse button

Anonymous 10 years ago 0
This discussion was imported from CodePlex

jst7 wrote at 2012-03-27 12:57:

Hey,

I'm succesfully catching the doubleclick event from the helixview BUT this event is not triggered when double clicking the middlemousebutton.

Any thoughts on what i could be missing?

p.s. same story when overriding the previewmouseevent!


objo wrote at 2012-04-05 01:35:

I guess this behaviour is caused by the ResetCameraGesture property being set to "MiddleDoubleClick". Try to change it to "None" or some other MouseAction!


jst7 wrote at 2012-04-05 10:05:

No results yet, but thanks for the reply

0

Bug in CameraController.AddRotateForce(double dx, double dy)

Anonymous 10 years ago 0
This discussion was imported from CodePlex

Elemental wrote at 2012-02-19 11:16:

Hello,

the method CameraController.AddRotateForce(double dx, double dy) always works as CameraMode.Inspect.

In my case, I have CameraMode set to WalkAround, which works fine for mouse controls, but keyboard control is wrong in that case.

 

I changed the method to

        public void AddRotateForce(double dx, double dy)
        {
            if (!this.IsRotationEnabled)
            {
                return;
            }

            this.PushCameraSetting();

            if (this.CameraMode == CameraMode.WalkAround)
            {
                this.rotationPoint3D = this.CameraPosition;
            }
            else
            {
                this.rotationPoint3D = this.CameraTarget;
            }
            this.rotationPosition = new Point(this.ActualWidth / 2, this.ActualHeight / 2);
            this.rotationSpeed.X += dx * 40;
            this.rotationSpeed.Y += dy * 40;
        }

 

which does kind of work, but rotating left/right via keyboard is inverted compared to mouse control.

What is the reason for the inverted controls?

 

Best Regards

Bernd

 

btw: Just downloaded the latest source code and changing the CameraMode in CameraControlDemo does not work anymore.


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

thanks for the feedback! I have only used the "Inspect" mode recently, it seems like the "Walkaround" mode is not working properly. I added it as issue 9949!


Elemental wrote at 2012-02-22 08:08:

Thank you.

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?)