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

Other Headlight

Anonymous 11 years ago 0
This discussion was imported from CodePlex

egse wrote at 2014-02-25 16:28:

I am using an other headlight. I think it's less dazzling if a surface is normal to the direction:

``` ` var lights = new Model3DGroup();
        SpotLight spot = new SpotLight(Colors.LightGray, new Point3D(), new Vector3D(), 180, 0);          

        lights.Children.Add(spot);
        Binding b = new Binding("Camera.LookDirection");
        b.Source = _myViewPort;
        BindingOperations.SetBinding(spot, SpotLight.DirectionProperty, b);


        Binding bnd = new Binding("Camera.Position") ;
        bnd.Source = _myViewPort;
        BindingOperations.SetBinding(spot, SpotLight.PositionProperty, bnd);


        _myViewPort.Children.Add(new ModelVisual3D { Content = lights });``

objo wrote at 2014-02-27 22:59:

Nice approach, but isn´t the result the same?

This is an interesting topic, I have been thinking about adding some properties to control the relative position of the headlight to avoid specular reflections on such surfaces.

Also, could multiple headlights give a better lighting model?

objo wrote at 2014-02-27 23:00:


egse wrote at 2014-03-04 08:04:

Yeah, nearly the same. But I like it more. Thought I share it. Your approach with an other relative position sounds very interesting
0

3D Text Rendering Sample for Helix SharpDX

Anonymous 11 years ago 0
This discussion was imported from CodePlex

VishwaPrasad wrote at 2014-07-25 13:43:

Hi,

I am using the Helix SharpDX, I have not found the text rendering sample for SharDX,

Can any one provide the sample application.

Thanks
Vishwa
0
Under review

Please help with vectorfieldvisual3D

rich 11 years ago updated by anonymous 6 years ago 3
i have this:
HelixToolkit.Wpf.HelixViewport3D viewport = new HelixToolkit.Wpf.HelixViewport3D();
HelixToolkit.Wpf.DefaultLights light = new HelixToolkit.Wpf.DefaultLights();
viewport.Children.Add(light);
viewport.ShowCameraInfo = true;
this.grid.Children.Add(viewport);
Vector3DCollection vectors=new Vector3DCollection();
Point3DCollection points= new Point3DCollection();
HelixToolkit.Wpf.VectorFieldVisual3D vfield = new HelixToolkit.Wpf.VectorFieldVisual3D();

//then the calculations of the vector field
while(i<=niterx)
{
j=0;
while(j<=nitery)
{
k=0;
while(k<niterz)
{
//caculations of a vector function go here. xvalue,yvalue,zvalue are spaced on a grid, and the functions give vectorvalx,vectorvaly, etc
points.Add(new Point3D(xvalue[i], yvalue[j], zvalue[k]));
vectors.Add(new Vector3D(vectorvalx[i, j, k], vectorvaly[i, j, k], vectorvalz[i, j, k]));
k++;
}
j++;
}
i++;
}

vfield.Positions = points;
vfield.Directions = vectors;


vfield.Diameter = 5;
vfield.HeadLength = 2;
vfield.Fill = new SolidColorBrush(Colors.Black);


viewport.Children.Add(vfield);



i cant figure out why its not working. the vectorfieldvisual3d doesnt render. What am i missing?
please help and merry xmas
0

Click Event not working anymore when using Helixtoolkit.SortingVisual3D

HI_ 10 years ago updated 10 years ago 0

I want to add transparency to Objects (without loosing the Click-Event). Google told me to try SortingVisual3D. Without SortingVisual3D everything (except transparency) worked well, Click-Events also.Now i tried to implement it (simplified code):

Public SV3d As New HelixToolkit.Wpf.SortingVisual3DPublic 
Model3DUI As New ModelUIElement3D

'Apply geometry
    Model3DUI.Model = geometry 'skipped geometry code in this post
'Add Click Event
    AddHandler Model3DUI.MouseLeftButtonUp, AddressOf ClickEvent
'Add to SortingVisual3D
    SV3d.Children.Add(Model3DUI)
'Add to ViewPort
    Viewport.Children.Add(SV3d)
'Setup SortingVisual3D
    SV3d.SortingFrequency = 2
    SV3d.Method = HelixToolkit.Wpf.SortingMethod.BoundingBoxCorners
    SV3d.IsSorting = True
Basically it works fine, everything renders as it should and transparency is working too. But for some reason now the Click Event doesn't work. Anybody has an idea what i'm doing wrong?

I'm not very experienced with Helixtoolkit, so it could be that my way is completely wrong.

0

Missing File: Plückers conoid.txt build error

Anonymous 11 years ago 0
This discussion was imported from CodePlex

kwcoffee1 wrote at 2014-02-10 15:13:

First, A very good toolkit for Wpf.... just what I'm looking for. However, I wanted to learn more about Wpf 3d graphical UIs so I download the Helix source for this purpose. But upon building the project, I get a file error: Error 1 File 'Expressions\Plückers conoid.txt' cannot be found. in project: SurfaceDemo.

How such I workaround this error?

King
0

question about walk around mode

Anonymous 11 years ago 0
This discussion was imported from CodePlex

behnam263 wrote at 2014-08-10 08:21:

I need to know how zooming and moving by mouse scroll or mouse pan works.
I mean if i zoom with scroll in walkaround mode which parameter changes by this(FOV or CameraPoszition.z or cameratarget.z or ....)
0

Updating 153600 spheres (GeometryModel3D) to display kinect depth data in real-time

Anonymous 11 years ago 0
This discussion was imported from CodePlex

pyrrhicpk wrote at 2012-11-04 13:05:

Hi,

I am using Helix 3D toolkit to display kinect depth data, an attempt to display the point cloud in the helix viewport3d. For this, I am creating spheres for each point as a GeometryModel3D and update their positions in the depthframe ready event. However, this method only works for upto 150 points. A depth format of 320x240 corresponds to 153600 points, and updating the positions of 153600 spheres freezes up the UI. In the depthframe ready event, I am simply updating the positions using

 geometryPoints[i].Transform = new TranslateTransform3D(x[i], y[i], z[i]);

where geometryPoints is an array of 153600 GeometryModel3D and x, y, z are the depth data from the depth stream.

Any suggestions to avoid the UI freezing. Or simply its not possible to update this amount of sphere geometries in helix viewport 3d at 30fps?

Please advise.

Thanks


objo wrote at 2012-11-06 19:36:

That sounds like millions of triangles. I don't think you can update that fast on the ui thread, even if you just update the transforms of the Model3Ds...

see also http://msdn.microsoft.com/en-us/library/bb613553.aspx


pyrrhicpk wrote at 2012-11-08 09:37:

Is it possible to do this using PointsVisual3D instead of adding spheres? I can draw the whole point cloud using PointsVisual3D containing a list of all the points, but I dont know how to update the points. Any idea?

Thanks

0

How to store 3d models aspecially STL files in database?

Ardahan 10 years ago updated 9 years ago 5

I'am reading an STL file in my WPF c# application. I want to store it to database. All database connections are done but I don't know how to store 3d model in database. What kind of converting needed for this purpose? And later similarly I want to get that information from database to turn it 3d models.Is there any basic function for STL converting to binaries then merging it again?

0

facematerial manipulator in code

Solutionideas mod 10 years ago 0

FaceMaterial default's color is blue , I need to change facematerial color by C#


I coding...

main.FaceMaterial = Materials.Red

and try to set transparent

main.FaceMaterial = nothing

it's not happen anything. 'main' it still 'Blue'


Please help. How can I change this property?

and Thanks to all answer and suggestion.

0

Apply Lights to HelixViewport3D ?

Anonymous 11 years ago 0
This discussion was imported from CodePlex

wa_dev wrote at 2012-12-26 21:00:


I'm trying to apply lights to an STL file I'm loading into the viewport, but all I get is black object. I've tried a few different things, and no luck so far. I saw a similar thread here ... 

wa_dev wrote at 2012-12-27 00:39:

Here is the code I got working (in my experimental code)... seems I'm am just a newb here

 

	private void Window_Loaded(object sender, RoutedEventArgs e)
        {

            this.SetHelixViewport();
            this.HelixViewport.Children.Add(new DefaultLights());
            this.HelixViewport.Children.Add(new ModelVisual3D() { Content = this.GetStlGeometryModel() });

        }


        private GeometryModel3D GetStlGeometryModel()
        {
            MeshBuilder builder = new MeshBuilder(true, true);
            this.GetStlReader().Meshes.ToList().ForEach(m => builder.Append(m));

            DiffuseMaterial dm = new DiffuseMaterial(Brushes.Red);

            GeometryModel3D gm3d = new GeometryModel3D();
            gm3d.Geometry = builder.ToMesh();
            gm3d.Material = dm;
            return gm3d;
        }

        private void SetHelixViewport()
        {

            this.HelixViewport.IsHeadLightEnabled = true;
            this.HelixViewport.CameraRotationMode = CameraRotationMode.Trackball;
            this.HelixViewport.ZoomExtentsWhenLoaded = true;
            this.HelixViewport.Children.Clear();
        
        }

        private StLReader GetStlReader()
        {

            StLReader reader = new StLReader();
            reader.Read(SAMPLE_STL_FILEPATH);

            return reader;
        }