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 is missing when using Prism to load the user control to a region

Anonymous 11 years ago 0
This discussion was imported from CodePlex

sowen wrote at 2014-02-04 19:48:

Hi,

don't know if anyone has experienced this:

I try to put HelixViewport3D in a user control like this
    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <h:HelixViewport3D ZoomExtentsWhenLoaded="True"
            x:Name="HelixViewport"
            Width="{Binding ActualWidth, ElementName=Container, Mode=OneWay}" 
            Height="{Binding Height, ElementName=Container, Mode=OneWay}">
            <h:SunLight />
        </h:HelixViewport3D>
    </Grid>
and in my Shell.xaml, I have this
<ContentControl cal:RegionManager.RegionName="MainCanvasRegion" Width="auto" Height="auto" />
Next, I use Prism to load the UserControl to the region like this
            _regionManager.RegisterViewWithRegion(Constants.RegionNames.MainCanvasRegion,
                                                  () => _container.Resolve<HelixCanvasView>());
the user control is placed to the ContentControl, but the user control has nothing in it.

I use Snoop to check. In the visual tree, the HelixCanvasView is in the tree, but underneather, it has nothing. Everything is gone. Very strange.

The way I am using Prism is correct. The shell has other regions, and other user controls are loaded properly. It's only this user control with HelixViewport3D. Well, technically, the control is loaded, but the HelixViewport3D is kicked out.

Does anyone know why?


Thanks

sowen wrote at 2014-02-05 15:57:

ok, I found out the problem of this issue. It's not really related to Helix control.

It feels more like a Microsoft bug.

For testing purpose, I was using a static resource of array for the items source, but as long as it's there, it kicks out the InitializeComponent method. So my user control becomes blank.

It's very strange, because the same way of defining the static resource works fine in Windows-level. The problem is only in the User Control level. and I can't find any reason or solution to it.
0

Using transparent PNGs for textures

Anonymous 11 years ago 0
This discussion was imported from CodePlex

Rogad wrote at 2014-02-09 23:37:

Hi,

I am doing quite well with my modelling. Got a little stuck though. Does HELIX allow for the use of transparent PNGs as a texture ?

I'm trying to get my human model's eyelashes to show up but they don't. I know I am locating the image okay because when I try to load a jpg in there it appears where the eyelashes should be.

The original texture for the eyelashes used alpha channel, but I don't think we can do that with HELIX at this time.

So, I used created a PNG of them instead, but then nothing appears at all. Surely something should appear ?

This is how the material looks in the MTL file :
newmtl 6_Eyelash
d 1
Kd 1 1 1
map_Kd Maps/V5BreeLashes1.png
I also made sure that the eyelashes are loaded last, as I was reading that transparent objects need to come last. Not sure if that's appropriate for what I am doing though.

Any thoughts ?

Rogad wrote at 2014-02-10 18:00:

I am so silly. I had two folders as I had to convert the alpha maps to PNG. Of course I forgot to transfer the eyelashes PNG to the working folder. So it was not finding it.

Shoot me now. All working once I had the ordering correct - transparencies need to come last !


0

TextureAddressMode

Anonymous 11 years ago updated by anonymous 8 years ago 1
This discussion was imported from CodePlex

Nikodem wrote at 2013-12-13 13:08:

Hello,

I have an application with Helix 3D Toolkit.
I am using seamless texture and I need to mapping textures (jpg) on the mesh in repeated mode (wrap mode).

mGeometries.Add(new GeometryModel3D(mesh, new DiffuseMaterial(imgBrush)));

for the imgBrush I need to have imgBrush with Wrap mode texture.

In the DirectX is enumerator TextureAddressMode.

http://msdn.microsoft.com/en-us/library/windows/desktop/bb206366(v=vs.85).aspx

How can I do this?

Many thanks
Jindrich

objo wrote at 2013-12-16 18:27:

0

Setting the Main View Model content.

Anonymous 11 years ago 0
This discussion was imported from CodePlex

Rogad wrote at 2013-12-04 20:23:

I'm working with the SimpleDemo and getting stuck as I am new to C#.

I see this in the code :
        /// <summary>
        /// Gets or sets the model.
        /// </summary>
        /// <value>The model.</value>
        public Model3D Model { get; set; }
I assume this is going to load and get the current model in the scene ?

So how can I load a model from outside of the MainViewModel.cs ?

Hopefully I can explain where I am. I reduced the size of the HelixViewPort and added a slider and a text box. At this point I am just playing, but lets say I want the slider to trigger models. So when it is to the right it is one model and to the left a different model.

I have some code I came up with for the form :
namespace ExampleBrowser
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    /// 

using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Media3D;

using HelixToolkit.Wpf;

    public partial class MainWindow : Window
    {
        public static int foo;

        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = new MainViewModel();
        }

        public void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {

            ObjReader CurrentHelixObjReaderb = new ObjReader();
            Model3DGroup MyCube = CurrentHelixObjReaderb.Read("C:/Users/Roger/Desktop/cube/cube-long.obj");

            // And now what ?!


        }

        
    }
}
Here's an image of my form that may help :




I'm just stuck on loading the model into the viewer. I can do it in the MainViewModel.cs quite easily
ObjReader CurrentHelixObjReaderb = new ObjReader();
            Model3DGroup MyEnd = CurrentHelixObjReaderb.Read("C:/Users/Roger/Desktop/cube/cube-long.obj");

            this.Model = MyEnd;
But due to C# being new to me I don't know how to do it elsewhere, like make it global or something.

Many thanks for any help :)

Rogad wrote at 2013-12-05 17:10:

Please delete this thread if you see fit. I realise I was leading myself up a blind alley.
0

HelixToolkit.SharpDX.Wpf_NET40 example run

Anonymous 11 years ago 0
This discussion was imported from CodePlex

cedrelo wrote at 2013-11-06 13:40:

Hi,

First, thanks for your work with helixtoolkit!
I use it to create a 3D application to display model 3D in .stl

Now i want to try your fork HelixToolkit.SharpDX.Wpf_NET40, but it is impossible to run and try the example.

It writes "Error registering effect, unable to load d3dcompiler_43.dll"

Could you help me ?

Thanks

Cédric

cedrelo wrote at 2013-11-06 15:05:

I put d3dcompiler_43.dll in c:/windows/system32


and now i have

"Tentative de chargement d’un programme de format incorrect. (Exception de HRESULT : 0x8007000B)"

"Attempt to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"

Any help would be fine ?


Cédric

przem321 wrote at 2013-12-02 20:28:

If you have errors with missing DirectX dlls (e.g. d3dcompiler_42.dll is missing) try installing the DirectX 2010 End-Users Runtime from: http://www.microsoft.com/en-us/download/details.aspx?id=8109 That applies also to Windows 8/8.1 even if it comes with a DX SDK.
0

Learning Helix3D while learning WPF help

Anonymous 11 years ago 0
This discussion was imported from CodePlex

David_NET wrote at 2013-11-23 01:21:

I am playing with Terrain Example

Currently the Source refers to a file to be uploaded using SurfacePlotVisual3D's

UpdateModel()

I am testing to use Helix3D as usercontrol through ElementHost in WinForm application

I am trying to figure out how to pass a new fileName string from WinForm so that I could define UpdateModel( FileName) and choose new file to load 3D data during run time.

Anyone know any example which I could study?
D.

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

Sorry, I don't know how to use it from winforms.
0

Implementing 3D Line Chart over time

Anonymous 11 years ago 0
This discussion was imported from CodePlex

sprotznock wrote at 2013-12-02 09:49:

Hi,

I began WPF 3D programming and I wanted to implement a Line chart which will be updated over time i.e. a kind of waterfall chart in 3D which displayes e.g. spectrums. I had two approaches for this implementation.
First: every spectrum is created as Visual3D with its own Material and GeometryModel3D
Sec: every spectrum is in one big Visual3D

What is the best approach to achieve the solution or is there any better way to do this? Performance is citical as well because it should be filled with live data.

Thanks

objo wrote at 2013-12-02 19:12:

For Visual3D vs. Model3D: have a look at http://blogs.msdn.com/b/danlehen/archive/2005/10/09/478923.aspx
The AudioDemo example in this library shows frequency spectra visualized by scaling boxes in one direction.

sprotznock wrote at 2013-12-03 19:00:

Thanks for the information. I will check this out and will decide which solution is the best.
0

Simple Geometry Lines

Anonymous 11 years ago 0
This discussion was imported from CodePlex

Aurega wrote at 2013-11-29 14:51:

Hello,

I´m just learning with WPF, I want to make simple line by using HelixViewport3D from XYZ coordinations to XYZ, but I can´t figure out which parameters I must use. I tried many combinations but without luck.
Can anyone help me with this ?

RobPerkins wrote at 2013-11-30 08:26:

Avail yourself of one of any number of online resources found by a Google or Bing search for "WPF 3D Tutorial". Charles Petzold's demos were particularly good.

objo wrote at 2013-12-02 19:59:

Drawing a line in WPF is not a simple task, drawing a triangle is much easier. Remember to add light(s) to the scene.
I agree with Rob - Petzold's book (and demos) is a great place to start!
0

Change materials at runtime

Anonymous 11 years ago 0
This discussion was imported from CodePlex

Tottel wrote at 2013-11-14 18:04:

Hi,

I've been using the Helix toolkit for a day now, and I just can't get my head wrapped around it.
I have my own WPF interface, and I can load and display a model into my scene. However, I just can't figure out how to change the materials on the model after loading the model from file.

Does anyone know?

Thanks!

Tottel wrote at 2013-11-19 20:18:

No one has any suggestions on how to do this?

objo wrote at 2013-11-19 22:22:

Did you try changing the Material property?
http://msdn.microsoft.com/en-us/library/system.windows.media.media3d.geometrymodel3d.material(v=vs.110).aspx

Also, make sure the model is not frozen.

Tottel wrote at 2013-11-20 00:11:

I didn't realize you could do that in XAML :D

I'll give that a try, thanks!

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

I think you need to change the material programatically if you load a model into the scene at runtime!

Tottel wrote at 2013-11-23 14:31:

objo wrote:
I think you need to change the material programatically if you load a model into the scene at runtime!
And how exactly would I access that material? I use a Model3D after loading in the mesh, but I really don't see where I can change the material anywhere.. :/

a5r wrote at 2013-11-24 10:48:

you can try setting the Material property of a GeometryModel3D to an instance of Material , for instance DiffuseMaterial

Tottel wrote at 2013-11-28 10:34:

Working great now; thanks a lot! :)
0

sync the cameras of different HelixViewport3Ds

Anonymous 11 years ago 0
This discussion was imported from CodePlex

lightxx wrote at 2012-12-19 08:49:

I'm designing a UI where i want to exclude a couple of Visual3Ds from hit - testing.

So I thought it would probably be a good idea to use two overlapping HelixViewport3Ds and set IsHitTestVisible to false on one of them to exclude those Visual3Ds from hit-testing.

Now, how do i sync the cameras of those two HelixViewport3Ds so when i pan/zoom/... the first one the second one stays in snyc?

Or is there a better approach to this problem?


lightxx wrote at 2012-12-19 09:14:

ok. the trick was to do two-way bindings. sorry.

 

<PerspectiveCamera LookDirection="{Binding ElementName=boardView, Path=Camera.LookDirection, Mode=TwoWay}"  Position="{Binding ElementName=boardView, Path=Camera.Position, Mode=TwoWay}" UpDirection="{Binding ElementName=boardView, Path=Camera.UpDirection, Mode=TwoWay}"/>


lightxx wrote at 2012-12-19 09:24:

the Viewports still have a slight offset ... weird.


objo wrote at 2012-12-19 09:27:

Did you try using UIElement3Ds

http://msdn.microsoft.com/en-us/library/system.windows.uielement3d.ishittestvisible.aspx


lightxx wrote at 2012-12-19 10:03:

thanks for pointing me in the right direction!!!