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

Materials won't load

Anonymous 12 years ago 0
This discussion was imported from CodePlex

sion005 wrote at 2011-10-26 17:49:

Greetings, I'm using Helix in an application to view 3d models, however, when I import the model, it's all black, with no materials. I tried several models, including the ones used on the Studio example, but the result was the same. Probably I'm doing some newbie mistake, but i would appreciate some tips to solve this.

 Here is the code that I use to load the model:

 // Fields
private TerrainCreator tc;
private Model3D CurrentModel;
private ModelVisual3D render;


public MainWindow()
{
this.InitializeComponent();

this.render = new ModelVisual3D();

this.CurrentModel = ModelImporter.Load("C:\\Users\\Pedro\\Desktop\\Helix\\HelixToolkit-Examples\\StudioDemo\\Models\\Ferarri40.3ds");

this.render.Content = this.CurrentModel;
this.view.Add(render); // this is the HelixView3D

}


objo wrote at 2011-10-26 20:43:

hi Pedro! a simple question first: did you add lights to your scene? Helix toolkit has a couple of light visuals, and also a 'headlight' in the HelixViewport3D control.


sion005 wrote at 2011-10-31 15:49:

Problem solved. I didn't had any lights! Thanks a lot!

0

Databinding HelixView (MVVM)

Anonymous 12 years ago 0
This discussion was imported from CodePlex

vuurvos wrote at 2011-04-21 16:08:

Hi,

I want to bind the HelixView3D to a model (MVVM design pattern). The only fully working way I found was by not using the MVVM design pattern. Since the MVVM pattern is a must and used in other all parts of the project, I want to use it also for the HelixView3D.

When I bind to the ModelVisual3D.content to its content in the model, the Viewport3DHelper doesnt work anymore. The viewport3DHelper doesn't detected a Visual3D which is near the clicked point. When I check the VisualChildernCount, its shows me one child.

I think the VisualChild isn't the child (3D Model) which I am clicking on. I guess its an ambientlight visual....

Regards

VuurVOS

 


zeux wrote at 2011-04-25 20:54:

try adding this to HelixView3D:

protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)

        {
            //base.OnItemsChanged(e);
           switch (e.Action)
            {
                case System.Collections.Specialized.NotifyCollectionChangedAction.Add:
                    Add(e.NewItems.ToList<Visual3D>());
                    break;
                case System.Collections.Specialized.NotifyCollectionChangedAction.Move:
                    break;
                case System.Collections.Specialized.NotifyCollectionChangedAction.Remove:
                    Remove(e.OldItems.ToList<Visual3D>());
                    break;
                case System.Collections.Specialized.NotifyCollectionChangedAction.Replace:
                    break;
                case System.Collections.Specialized.NotifyCollectionChangedAction.Reset:
                    ClearChildren();
                    break;
                default:
                    break;
            }
        }
works like a charm for me - it's not fully implemented, obviously - but I think you get the idea


objo wrote at 2011-06-19 12:27:

vuurvos: I added a MvvmDemo that binds to HelixVis3D.ItemsSource. Adding new Visual3Ds should work now. (In the past I have used to add Visual3Ds in the XAML and bind to Model3Ds in the ViewModels)

zeux: thanks for pointing out the missing code! I added it to HelixView3D with some modifications (seems like you have added different Add/Remove methods) The implementation of Move and Replace is also remaining, as you point out.  

The MvvmDemo is not complete, will add more when I learn more Caliburn.Micro...

0

Orientation of image assigned to SphereVisual3D

Anonymous 12 years ago 0
This discussion was imported from CodePlex

tacheleu wrote at 2012-12-07 20:42:

I am using the helixtoolkit of codeplex.

¿How I can set the orientation of the image that I assign to a sphere3D?

I can assign the ImageMaterial but ¿how to rotate/orientate the image?

Thanks in advace


objo wrote at 2012-12-07 21:25:

To rotate the image, try applying a Transform2D to the TextureCoordinates in your sphere geometry.

Or create a material from a VisualBrush or ImageBrush that contains a rotated image (slower performance).

http://msdn.microsoft.com/en-us/library/system.windows.media.transform(v=vs.95).aspx
http://msdn.microsoft.com/en-us/library/system.windows.media.media3d.meshgeometry3d.texturecoordinates.aspx

0

F1 = click on bottom of cube

Anonymous 12 years ago 0
This discussion was imported from CodePlex

bennasi wrote at 2012-12-03 11:45:

Hi,

How can I make this:

If I press F1 I would like the same thing to happen (switch view) as it would do when clicking on the bottom of the view cube.

 

Thanks


objo wrote at 2012-12-03 21:26:

I think it should be possible to add a KeyBinding to the CameraController.BottomViewCommand!

But why F1? That's for help!


bennasi wrote at 2012-12-04 11:05:

Want to use the keybindings as they are in another software package (ANSA).
so I want to change the function keys to default camera positions. 

I cannot find the helixviewport.cameracontroller.bottomviewcommand.
Could you give me some sample code please. 

0

Using Helix 3D with Visual C# Express

Anonymous 12 years ago 0
This discussion was imported from CodePlex

cobra18t wrote at 2011-11-28 17:53:

How can I use the Helix 3D toolkit with Visual C# Express 2010? The suggested SVN method requires an internet connection, which I cannot get on my development machine and NuGet does not work on Visual C# Express 2010. Does anyone know a way around this?

-Thomas


objo wrote at 2011-11-28 19:07:

hi Thomas, you have a "Download" link under the source code page. This will give you everything in a zip. Good luck!

0

scrollwheel zoom stops on large scene

Anonymous 12 years ago 0
This discussion was imported from CodePlex

mihaipruna wrote at 2014-08-17 17:53:

on a scene that spans a wider expanse of xy space,with multiple features, I cannot zoom in on a feature as much as when that feature was by itself. The scrollwheel simply stops zooming in, but the panning distance when dragging the mouse keeps decreasing, so it looks like your camera is "stuck"
Is there a way to enable more zoom on a bigger scene?

mihaipruna wrote at 2014-08-19 17:26:

I figured it out based on another post here:
private void hv_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
        {
           
            if (hv.Camera.LookDirection.Length >= 800 && e.Delta < 0)
            {
                Vector3D vava = hv.Camera.LookDirection;
                vava = Vector3D.Multiply(800 / vava.Length, vava);
                hv.Camera.LookDirection = vava;
            }

            if (hv.Camera.LookDirection.Length <= 1 && e.Delta > 0)
            {
                Vector3D vava = hv.Camera.LookDirection;
                vava.Normalize();
                hv.Camera.LookDirection = vava;
            }
        }
0

How to import 3ds with materials

Anonymous 12 years ago 0
This discussion was imported from CodePlex

musicxpg wrote at 2013-02-26 05:40:

I am using the example "ModelViewer" in "helixtoolkit\Source\Examples\ModelViewer" to load 3ds file. I found the materials are not loaded. I am new to 3d WPF. Could anybody tell me how to load these materials together?

Than you!
Young

musicxpg wrote at 2013-02-26 06:14:

I found the reason. I removed the files to another address. It is why the materials were missed.

Many thanks to author's amazing Helix 3D toolkit!
0

Programmatic control of camera parameters

Anonymous 12 years ago 0
This discussion was imported from CodePlex

AnotherBor wrote at 2013-11-20 07:26:

Hi,

First of all I want to say big THANK YOU to all the contributors and authors of Helix. THIS IS OSOM!

Now to the point.
I need to control FOV, point of view and other parameters of the scene in the code but with the visual effects provided by manual control.
For example, if I change camera FOV in CameraSettings in the code, the FOV changes instantly but other properties of the camera remain unchanged. That's obviously how it's supposed to be.
But when you change camera FOV using mouse, the distance of the camera is adjusted (behind the scenes) so that apparent perspective changes, but ZOOM remains constant.
How can I achieve the same in the code??

I have same question/requirement for other parameters. For example, it's super easy to control the point of view of camera using mouse. How could I change the camera position with the same nice animation and effects in code instead?

objo wrote at 2013-12-02 20:08:

Try the methods AddPanForce, AddRotateForce and AddZoomForce in the CameraController.
ChangeDirection and LookAt has animation time parameters, I agree there should also be a ChangeFov method! I added an issue: https://helixtoolkit.codeplex.com/workitem/10010

AnotherBor wrote at 2014-01-03 14:48:

Thank you very much for the information.
I have to say, I'm deeply impressed with helixtoolkit. Really great work!!
I'm sorry for not replying earlier. Too many things on my head.
0

Cylindrical panoramas

Anonymous 12 years ago 0
This discussion was imported from CodePlex

Provagino wrote at 2012-01-09 16:41:

How I do create a cylindrical panorama? ( Image source http://blog.360cities.net/)
Thanks


objo wrote at 2012-01-09 19:32:

A simple cylinder with the panorama as a texture should work! For spherical panoramas, use a sphere.

Remember to place the camera in the middle of the cylinder/sphere! And use an emissive material or ambient light!

0

AddTriangles error/fix

Anonymous 12 years ago updated by asim 6 months ago 1
This discussion was imported from CodePlex

mentalarray wrote at 2012-04-08 04:32:

Hi

there seemed to be an error in the triangleIndices code for AddTriangles as i had points in all wrong places i have added code that fixes it below

//Not working (old code)

 /*
            int indexEnd = this.positions.Count;
            for (int i = index0; i + 2 < indexEnd; i++)
            {
                this.triangleIndices.Add(i);
                this.triangleIndices.Add(i + 1);
                this.triangleIndices.Add(i + 2);
            }
             */


//Working

           for (int i = 0; i < this.positions.Count; i+=3)
            {
                this.triangleIndices.Add(i);
                this.triangleIndices.Add(i + 1);
                this.triangleIndices.Add(i + 2);
            }

 


objo wrote at 2012-04-08 13:10:

thanks! I submitted a fix on the AddTriangles method. Notice that the triangle indices should be based on the index of the first point added (this will allow AddTriangles to be called multiple times). I also corrected some errors in the argument checks.

I found that this method is currently not in use in the library, but I will leave it there in case someone use it. Will add more unit tests/examples for the mesh builder later.


Mentalarray wrote at 2012-04-08 13:24:

Oh great objo yea i realised about the index afterwards as i was adding my object all in one go good point 

great work on the whole library btw,,,