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

Cloth Simulation from 3D Object

Anonymous 11 years ago 0
This discussion was imported from CodePlex

charismatubagus wrote at 2013-02-20 06:49:

Hi,

I would like to know how I can load 3D Cloth Simulation file such as .obj from external software like Blender. Please reply with sample codes. Thanks a lot.

objo wrote at 2013-03-12 11:47:

It should be possible to load standard .obj files, use the ObjReader class. The Read method will return a Model3D. I don't know of any 'cloth' properties in the .obj file format, can you provide a link?

adrianreza wrote at 2013-03-25 03:51:

Hi, I have same question but little different, how can I implement cloth simulation with cloth model exported from 3D software like blender. I saw the cloth examples with flag model, is it possible for helixtoolkit to create similiar cloth simulation with cloth model and combine it with kinect sensor? Thanks.

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

The VerletIntegrator may be reusable, but I will probably move this out of the library soon. I think you need a real 3D physics engine if you need to solve more advanced models. The cloth example was just a small test on WPF3D performance based on Thomas Jakobsens 'Advanced Character Physics' article.

The Kinect sensor is not supported in the toolkit (I don't want to add a reference to the Kinect SDK), but there is an example how to use Kinect with the toolkit!
0

Issue in FindAnyPerpendicular

Anonymous 11 years ago 0
This discussion was imported from CodePlex

rys322 wrote at 2012-02-03 16:55:

Objo,

1. First off thank you for all of your hardwork, helixtoolkit is truly amazing.

2. I believe I have found a bug in the FindAnyPerpendicular function of the Vector3DExtensions class. When called by AddTube the function can sometimes bombs out due to the Vector3D n being comprised of very small numbers and so the CrossProduct returns nan. I was able to resolve this issue by adding the line

n.Normalize();

as the first line of the FindAnyPerpendicular function. This does leave n normalized, so it might be better to create a copy of n first and normalize the copy and use that for calculating the crossproduct. 

3. I was also wondering if there is a way to force the a helixviewport to repaint or refresh. I have found that when I make changes and the mouse isn't over the toolkit the changes in my models are not shown until I mouse over the helixviewport.

 

Thanks,

Jordan


objo wrote at 2012-02-05 07:00:

#1: thank you!

#2: thanks for the bug report! See change list 74632. It seems it is not necessary to create a copy of the input vector first. I added some unit tests that also check that the input vector is unchanged.

#3: no there is no repaint/refresh command in HelixViewport3D or System.Windows.Controls.Viewport3D. There should be no need for it. Are you experiencing this with any of the properties of the Visual3D objects in this library? Then check that I have not forgot a property changed callback that updates the underlying model!

0

Possible bug in OBJ importer ?

Anonymous 11 years ago 0
This discussion was imported from CodePlex

Rogad wrote at 2014-02-26 15:12:

I've touched on this before, but thought I would start a fresh thread.

I have an .OBJ model with 5 groups.
The five groups use a combination of materials.
One group may refer to more than one material.
The .OBJ file contains 33 references to these materials within the 5 groups.

When I load the OBJ file via Helix I end up with a model with 33 groups rather than the expected and desired 5 groups.

It seems the importer is making groups/children from each material rather than the OBJ file group.

Is this behaviour intended ?

It makes it impossible to run code on a single group, because its been split up.

When viewed in the model viewer the model appears as desired so there is no problem with mapping the textures.

Rogad wrote at 2014-02-26 15:43:

P.S. The model loads fine in MeshLab

Rogad wrote at 2014-02-26 18:19:

Just pulling the old topic in here : https://helixtoolkit.codeplex.com/discussions/528072

I changed my mind again. I think I was on track when I was suggesting the importer was making too many groups.

Because I can now answer this question :

objo wrote:
Can a group contain meshes with different materials?
In that case it is possible that the importer adds a new model for each mesh. The output model could be changed to a hierarchy, where the first level correspond to the groups.
The answer is yes a group can contain meshes with different materials :)

If that could be be changed to a hierarchy as you suggest then that may work for the best.

Rogad wrote at 2014-02-26 22:35:

Was thinking... yeah I do that !

I was concerned that implementing the hierarchy might break a lot of people's code.

I overcame my problem with multiple groups by de-fragmenting my model before I import it into Helix.

I think I have to live with a mesh being broken into groups to suit the materials.

So really it's up to you if you want to change the way it works, though my vote would go for a hierarchy.
0

Error with PepitaGet.RestorePakackagesTask

Anonymous 11 years ago 0
This discussion was imported from CodePlex

GreenGiant83 wrote at 2013-02-12 14:06:

When trying to compile a few of the example projects, like the examplebrowser or the mvvmmanipulator, I get a build error regarding PepitaGet. What do I need to resolve it?

Error 1 The "PepitaGet.RestorePackagesTask" task could not be loaded from the assembly D:\Dropbox\Programming\CSharp\Examples\helixtoolkit_8c0d58aa0295\Source\Examples\ExampleBrowser..\Tools\Pepita\PepitaGet.dll. Could not load file or assembly 'file:///D:\Dropbox\Programming\CSharp\Examples\helixtoolkit_8c0d58aa0295\Source\Examples\Tools\Pepita\PepitaGet.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. D:\Dropbox\Programming\CSharp\Examples\helixtoolkit_8c0d58aa0295\Source\Examples\ExampleBrowser\ExampleBrowser.csproj 674 5 ExampleBrowser

objo wrote at 2013-02-12 22:06:

Did you create a new solution file in a different directory? Then you need to correct the path to ~/Tools/Pepita/PepitaGet.dll in the .csproj files.
When the solution is in the ~/Source/ folder, the correct path is
<UsingTask TaskName="PepitaGet.RestorePackagesTask" AssemblyFile="$(SolutionDir)..\Tools\Pepita\PepitaGet.dll" />
0

Changes latest version?

Anonymous 11 years ago 0
This discussion was imported from CodePlex

davidop wrote at 2013-08-02 16:55:

What are the main changes in this latest version? I just have not found the change log.

objo wrote at 2013-08-08 08:19:

See the change list descriptions - click "History" under the "Source code" tab. A new version is normally built at every code check-in.

davidop wrote at 2013-08-08 09:56:

Thank you!. My question was because I was interested in the new version if it had included the limits of the camera zoom. We'll have to keep waiting.
0

How to pause/resume a rotation?

Anonymous 11 years ago 0
This discussion was imported from CodePlex

BogusException wrote at 2014-07-30 21:25:

Experts,

I had awful luck with rotating my object and it keeping it's lat/lon straight, so I did the below-which I think is rotating my camera around the single object I have...

I want to let me users stop & start the rotation (menu, keypress, all in code-behind), but all I can do now is either in XAML... I might be doing this wrong, and as a result the right way is eluding me..

Thoughts?

<Grid.Triggers>
        <EventTrigger RoutedEvent="Canvas.Loaded">
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimation x:Name="camRotate360"  
                                     AutoReverse="False" 
                                     Duration="0:1:00" 
                                     From="360" 
                                     RepeatBehavior="Forever" 
                                     Storyboard.TargetName="camRotation" 
                                     Storyboard.TargetProperty="Angle" 
                                     To="0" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Grid.Triggers>
[...]
 <t:HelixViewport3D x:Name="view1" 
                       CameraRotationMode="Turnball"
                       ClipToBounds="False"
                       Grid.Column="0" 
                       IsChangeFieldOfViewEnabled="True"
                       IsHeadLightEnabled="True" 
                       IsHitTestVisible="True"
                       IsInertiaEnabled="True"
                       IsManipulationEnabled="True"
                       IsMoveEnabled="True"
                       IsPanEnabled="False"
                       IsRotationEnabled="True"
                       IsTouchZoomEnabled="True"
                       IsZoomEnabled="True"
                       LeftRightRotationSensitivity="5"
                       MouseDown="OnMouseDown" 
                       MouseMove="OnMouseMove" 
                       RotationSensitivity="5"
                       ShowCameraInfo="False"
                       ShowCameraTarget="False"
                       ShowCoordinateSystem="False"
                       ShowFieldOfView="False"
                       ShowFrameRate="True"
                       ShowTriangleCountInfo="True"
                       ShowViewCube="False"
                       SubTitle=""
                       SubTitleSize="0"
                       Title=""
                       TitleSize="0"
                       ZoomExtentsWhenLoaded="True" 
                       ZoomSensitivity="2"
                       ZoomAroundMouseDownPoint="True">
        <t:HelixViewport3D.Camera>
            <PerspectiveCamera Position="600,27400,0" 
                               LookDirection="0,1,0" 
                               UpDirection="0,0,1" 
                               NearPlaneDistance="0.01" 
                               FarPlaneDistance="Infinity" 
                               FieldOfView="40">

                <!-- I have to comment out the below to make the shape not rotate -->
                <!--<PerspectiveCamera.Transform>
                    <Transform3DGroup>
                        <RotateTransform3D>
                            <RotateTransform3D.Rotation>
                                <AxisAngleRotation3D Axis="0,0,1" Angle="0" x:Name="camRotation" />
                            </RotateTransform3D.Rotation>
                        </RotateTransform3D>
                    </Transform3DGroup>
                </PerspectiveCamera.Transform>-->

            </PerspectiveCamera>
        </t:HelixViewport3D.Camera>
0

Any Help

Anonymous 11 years ago 0
This discussion was imported from CodePlex

elkhalafy wrote at 2013-08-06 12:56:

peace on U

brothers, I want to create 3d modelling app with helix so can I do that with helix TK, or anyone know library for .net and compatible with Helix 3d TK for 3d modelling ?

I want anyone help me ,
Thanks,

elkhalafy wrote at 2013-08-09 14:03:

No answers ,

OK I want make modelling WPF 3D APIs with support of helix TK

Mrme wrote at 2013-08-12 15:52:

I can't see a question here. just go use helix and when you have troubles come back to ask
0

CompositionTarget.Render and ZoomExtents

Anonymous 11 years ago 0
This discussion was imported from CodePlex

Badgor wrote at 2013-11-01 19:43:

Hello,

This is probably a trivial problem, but I'm new to C# and WPF, and I've been scratching my head for some time now.
I'm using a CompositionTarget.Render, such that I can disable and re-enable some parts of the rendering (think I got this from the Points and Lines example).

Before I got all this to work, I used the Loaded += MainWindow_Loaded like in a lot of the examples. This included the ZoomExtents. A neat little feature.

I would like to know how I can incorporate this with the Compositiontarget.Render.

Some code below.
        public MainWindow()
        {
            InitializeComponent();
            DataContext = this;
            CompositionTarget.Rendering += this.OnCompositionTargetRendering;            
       }
        void OnCompositionTargetRendering(object sender, EventArgs e)
        {

            if (ShowEdges && lines == null)
            {
                lines = new LinesVisual3D { Color = Colors.Red };
                view.Children.Add(lines);
            }
            if (!ShowEdges && lines != null)
            {
                lines.IsRendering = false;
                view.Children.Remove(lines);
                lines = null;
            }
            if (ShowFaceNormals && faceNormals == null)
            {
                faceNormals = new LinesVisual3D {Color = Colors.Purple};
                view.Children.Add(faceNormals);
            }
            if (!ShowFaceNormals && faceNormals != null)
            {
                faceNormals.IsRendering = false;
                view.Children.Remove(faceNormals);
                faceNormals = null;
            }
            if (ShowFaces && faces==null)
            {
                faces = new ModelVisual3D
                {
                    Content = new GeometryModel3D
                    {
                        Material = Materials.Red,
                        BackMaterial = Materials.Blue
                    }
                };

                view.Children.Add(faces);
            }
            if (!ShowFaces && faces != null)
            {
                view.Children.Remove(faces);
                faces = null;
            }

            if (lines != null)
            {
                createWireframe();
            }
            if (faceNormals != null)
            {
                createFaceNormals();
            }
            if (faces != null)
            {
                createFaces();
            }
        }
0

PipeVisual3D is transparency issue

Anonymous 11 years ago updated by anonymous 6 years ago 0
This discussion was imported from CodePlex

Mrme wrote at 2013-11-04 14:26:

hi,
I added some models first and then added a PipeVisual3D , when I make the PipeVisual3D transparent by changing the Material and BackMaterial opacity, those models I added first appear just fine inside the pipe when I look from outside side, but if I added some models after I already add the PipeVisual3D, none of these appear , it looks transparent but it actually it is not , I would appreciate any clue

RobPerkins wrote at 2013-11-05 17:34:

You must manually control the order of the Visual3D elements which you add to the scene, since WPF doesn't do transparency in the same way as OpenGL or even DirectX.

Add your Visual3Ds in order of decreasing opacity to get the right effects.

Rob

Mrme wrote at 2013-11-05 18:43:

Thanks for your reply, Opacity is just for the PipeVisual3D, so the models are always with Opacity = 1, I don't have the choice here, the users want to be able to add some models/PipeVisual3D and delete them at any time, as I understood from your post , I have always to make sure that the models have to be as if they were added first, when I add a new model and change it's position on the tree,would that solve my problem ?
Thanks

RobPerkins wrote at 2013-11-06 15:02:

Yes, it's just as you described. WPF renders the elements in list order. Just make sure the elements with less opacity are last in the list.

At times, I do this by specifying one list of Visual3Ds for the opaque stuff, and a second list for the non-opaque, stuff, and lay that out in the XAML. That pretty much guarantees the right behavior.

Rob

a5r wrote at 2013-11-06 15:24:

maybe you can use ElementSortingHelper.SortModel(Point3D position, IList<Visual3D> model);
0

SharpDx version 2.5?

Anonymous 11 years ago 0
This discussion was imported from CodePlex

activity1 wrote at 2013-12-19 21:18:

Hi,
the fork for SharpDx is on version 2.4.0.
My need is to add DirectD2D1 library, but I only have it since 2.4.2. However, when I change Helix3D/SharpDx to either 2.4.2 or 2.5 (latter needs modifications in Helix.SharpDx), only a white page is rendered.
Q1: Is that normal? I am using Windows7.
Q2: Are there plans to update, or is that the reason why it is on old version?
Q3: Else, my problem is that I do not find the D2D1 lib for SharpDx 2.4.0 on the web, could somebody please help or advise.

Thanks a lot in advance,
Helix3D is a great help,
rüdiactivity

objo wrote at 2014-01-07 22:28:

pm knows more about this fork than myself.
Q2: I think we should follow the latest stable version of SharpDx