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

How to implement the VisualHelper.TraverseModel for loaded model

Anonymous 11 years ago 0
This discussion was imported from CodePlex

mateovidro wrote at 2013-03-07 22:32:

Hi obj,
I try to use Visualhelper Class to subdivide the model graph of my imported model (.stl).
I try to use the Subdivision project and modify the UpdateModel(), but I get the triangle subdivision but not efect in the loaded model(Visual)
private void Load(string model) {
CurrentModel = ModelImporter.Load(model);

Visual3DHelper.TraverseModel<Model3D>(CurrentModel, ????);

I like the way to smoothing meshes but in code behind, loaded from database. Or any help!!

Thanks
0

Mesh reduction

Anonymous 11 years ago 0
This discussion was imported from CodePlex

pDeac wrote at 2014-08-20 14:49:

Hello,

Is there any build in support in Helix 3D for reducing the triangles of a mesh geometry ?

Thanks
Paul

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

Sorry, no. Only the opposite :-)
We could add a feature request. Does anyone know how to do this?
0

Camera Controller - key board input for panning

Anonymous 11 years ago 0
This discussion was imported from CodePlex

Tungsten wrote at 2012-04-26 18:26:

Firstly, thank you for the great work.

 

My question relates to the behavior of the keyboard panning (shift-arrows).

Clicking left causes the camera to move to the right (model moves to the left).  I realize this is is just a difference in perspective, however feedback I have received indicates that this is counter-intuitive to them.  These folk are video game players in which the more common pan would yield the camera moving in the same direction.

 

Would it be possible to have an inversion property added?  I investigated stealing keyboard events or overriding gestures, but the camera controller is attaching itself to the keydown event directly.  The only option I found is to disable panning, however I still need panning to occur via addPanForce (which I invoke directly from an onscreen controller I created).

 

Thanks.


objo wrote at 2012-04-26 23:07:

I added a LeftRightRotationSensitivity property. Try to set this to -1 to invert the keys. 


Tungsten wrote at 2012-04-27 00:17:

Thank you for the quick response.

 

The LeftRightPanSensitivity and UpDownPanSensivity are exactly what I need, however did you intend to not add the template bindings for all 5 new sensitivity properties (the 2 rotations were added).   I am applying the properties to the CameraController directly for now.


objo wrote at 2012-04-27 06:48:

Of course, I had forgotten the 3 last ones. Thank you, fix submitted.

0

Rotate camera

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

solcruiser wrote at 2011-12-12 15:03:

Hi,

how can i rotate the camera in per code?

i can't find any methods for that in CameraController.

(or schould i use wpf's RotateTransform3D)

greetz chris


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

you can use the "AddRotateForce" method - that's what the keyboard bindings are using.

If you need more custom rotations, I suggest you create a Quaternion and do the rotations on the LookDirection and Camera Position.

You find the camera rotation transformations in the RotateHandler class.

0

error in deisgner: The type 'HelixToolkit:HelixViewport3D' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built

Anonymous 11 years ago 0
This discussion was imported from CodePlex

Noylene wrote at 2013-01-21 14:47:

why do I have this error when opening XAML designer in any example project, or creating my own (adding reference manually or with Nuget, doesn't matter)?

In editor IntelliSense 'knows'  namespace HelixToolkit but don't know anything inside it

Beside this, project compiles and runs

VS2010, .Net 4.0


mannest wrote at 2013-01-25 06:47:

I have same problem.

Did you build HelixToolkit.Wpf_NET40 project in x64 platform?

In my case, no problem in x86 platform built.

Anyway, I don't know how to solve that problem in x64 platform.


Noylene wrote at 2013-01-25 07:07:

No, it's x86, WinXP


JohnSourcer wrote at 2013-01-25 07:10:

It's a known problem and doesn't affect the build. There are several reports of this and workarounds/solutions. Most common seems to be issues with 64 bit vs 32 bit builds and dll's.

0

Help using Meshbuilder to create a line between two spheres

Anonymous 11 years ago 0
This discussion was imported from CodePlex

pyrrhicpk1 wrote at 2012-10-15 11:40:

Hi,

I am using the following code to draw a sphere in HelixViewport3D. Now I want to create a 3D line between two spheres. Any suggestions please.

Thanks

var meshBuilder = new MeshBuilder(false, false);
meshBuilder.AddSphere(new Point3D(0, 0, 0), 0.1f, 10, 10);
var mesh = meshBuilder.ToMesh(true);
modelGroup = new Model3DGroup();
var greenMaterial = MaterialHelper.CreateMaterial(Colors.Green);
var insideMaterial = MaterialHelper.CreateMaterial(Colors.Yellow);

            mygeometry = new GeometryModel3D();
            mygeometry.Material = greenMaterial;
            mygeometry.BackMaterial = insideMaterial;
            mygeometry.Geometry = mesh;

           modelGroup.Children.Add(mygeometry);    

           myModelVisual3D = new ModelVisual3D();
           myModelVisual3D.Content = modelGroup;

           myview.Children.Clear();
           myview.Children.Add(myModelVisual3D);


objo wrote at 2012-10-16 15:36:

use a cylinder? See MeshBuilder.AddCylinder

To draw a line, try LinesVisual3D.


pyrrhicpk1 wrote at 2012-10-17 03:58:

Thanks.

Much appreciate.

0

InvalidOperationException when setting opacity

Anonymous 11 years ago 0
This discussion was imported from CodePlex

keegean wrote at 2011-10-27 01:34:

I was trying to change the opacity on a material using the MaterialHelper and it gave me the following exception:

System.InvalidOperationException was unhandled by user code
  Message=Cannot set a property on object '#FFFFFF00' because it is in a read-only state.
  Source=WindowsBase
  StackTrace:
       at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
       at System.Windows.Media.Brush.set_Opacity(Double value)
       at HelixToolkit.MaterialHelper.ChangeOpacity(Material material, Double d)
       at HelixToolkit.MaterialHelper.ChangeOpacity(Material material, Double d)
       at Boids.BoidsViewModel.AddSightBoxes()
       at Boids.BoidsViewModel.set_ShowSight(Boolean value)
  InnerException:

 

I had created a Visual3D object and I set the material on it. I wanted to change the opacity so I used the helper. I passed in the Material of the Visual3D object, that is when I received this exception.


objo wrote at 2011-10-27 08:59:

is your material frozen? can you try changing the material without the helper method from Helix Toolkit?


keegean wrote at 2011-10-29 14:54:

I think the material was frozen. I was able to create the material and then modify it with the helper and then set on the object.

0

This api was accessed with arguments from the wrong context

Niteen 10 years ago updated by Asdf Fdsa 4 years ago 2
Hello,

We are adding and removing the ModelVisual3D object using background worker process and we got the the following error message:

Error : "This api was accessed with arguments from the wrong context"

Here is my code:

Private Sub backgroundWorker_ProgressChanged(sender As Object, e As ProgressChangedEventArgs)

Dim list = helixViewport3D.Children.OfType(Of ModelVisual3D).ToList()
For Each item As ModelVisual3D In list
If TypeOf item Is ModelVisual3D AndAlso item.GetName() = "Mesh" Then
helixViewport3D.Children.Remove(item)
End If
Next
Dim visual = CType(e.UserState, ModelVisual3D)
helixViewport3D.Children.Add(visual)
End Sub

We are used the BackgroundWorker thread to update the UI from background process. Can you please suggest how to solve this issue.

Please find the attached screem shot.


Thanks,
Niteen Patil







0

Right Mouse click

Anonymous 11 years ago 0
This discussion was imported from CodePlex

egse wrote at 2014-02-04 16:05:

Hi,

I am trying to get a hit test on the right mouse click.
However, I think the viewport is consuming the Event even I don't want to rotate. Is it possible to only consume the Event if the mouse has moved during the mousedown Event?
0

Reset camera on Zoom

Anonymous 11 years ago 0
This discussion was imported from CodePlex

JohnSourcer wrote at 2013-01-23 11:41:

Hi All,

I configure a camera at a sphere as follows, but when I zoom and then rotate it, it no longer rotates the sphere but seems to remember the original axis and rotates around that. Do I have to reset it or is there some way of always making sure it rotates around the center of the sphere:

view = sender as HelixViewport3D;
CameraController cameraController = view.CameraController;
cameraController.IsPanEnabled = false;
cameraController.CameraRotationMode = CameraRotationMode.Turntable;
cameraController.TouchMode = TouchMode.Rotating;
cameraController.CameraMode = CameraMode.Inspect;
cameraController.InertiaFactor = 0.5;

 

 


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

Maybe the up axis (the ModelUpDirection property) should be changed to 0,1,0? (in this toolkit the default up axis is 0,0,1) 


JohnSourcer wrote at 2013-01-24 12:27:

Thanks for the reply, objo.

Sadly that doesn't help. You can observe this behaviour in your Earth Demo. If you start infinite spin rotation on the globe, stop it, scale the globe (down or up) and then start infinite spin again. 

BTW, this is an excellent bit of work. I know others have mentioned this but I too would be happy to pay for it. Reasonably ;)