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

Unable to run WPF.SharpDX demos

Van 2 years ago in Question • updated 2 years ago 1

I am trying to evaluate helixtoolkit for use in an existing WPF application. I cloned the repo and compiled everything, but when I try to execute any of the WPF.SharpDX examples I get an error message in the application:


System.InvalidOperationException: Cannot call this method without a back buffer.
   at System.Windows.Interop.D3DImage.AddDirtyRect(Int32Rect dirtyRect)
   at HelixToolkit.Wpf.SharpDX.DPFCanvas.UpdateAndRender() in C:\helix-toolkit\Source\HelixToolkit.Wpf.SharpDX\Controls\DPFCanvas.cs:line 753


However, I think this is a bit misleading. When I look at the code, it is failing on line 102 of DX11ImageSource:


this.renderTarget = new Texture(DX11ImageSource.device, target.Description.Width, target.Description.Height, 1, Usage.RenderTarget, format, Pool.Default, ref handle);      

With the following exception thrown: 


'SharpDX.SharpDXException' in SharpDX.dll
HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.


I even tried making my own possibly simpler project and using NuGet to import the helixtoolkit libraries and I get the same error. At home I can execute everything on my personal computer so it appears to be some (mis)configuration on my work laptop. Both machines are Windows 10, using VS2017 with AFAIK updated drivers. I'm not sure where to go from here to diagnose the error.


I have also tried Microsoft's WPF DirectX Extensions (https://github.com/Microsoft/WPFDXInterop) and it works properly. Finally, I tried compiling SharpDX but it doesn't include any sample code for me to run. If anyone has any suggestions, I'd love to hear them.

SharpDX WPF
0

Problem with transparent background at TextVisual3D

MarioR 2 years ago in Question 0

Hello,

is it correctly that the TextVisual3D only display the transparent backgorund from last insert TextVisual3D?



        <helix:HelixViewport3D ZoomExtentsWhenLoaded="True" ShowCoordinateSystem="True"  CameraMode="Inspect">
            <helix:SunLight />
            <helix:TextVisual3D Position="1,-1,1" Text="Hello"  Foreground="Aqua" Background="Transparent" UpDirection="0,0,1"  Height="1"/>
            <helix:GridLinesVisual3D Width="10" Length="10" MinorDistance="1" MajorDistance="1" Thickness="0.01"/>
            <helix:SphereVisual3D Center="0,0,0" Radius="0.5" />
            <helix:EllipsoidVisual3D Center="3,3,3" RadiusX="2" RadiusY="3" RadiusZ="4" />
        </helix:HelixViewport3D>




        <helix:HelixViewport3D ZoomExtentsWhenLoaded="True" ShowCoordinateSystem="True"  CameraMode="Inspect">
            <helix:SunLight />
            <helix:GridLinesVisual3D Width="10" Length="10" MinorDistance="1" MajorDistance="1" Thickness="0.01"/>
            <helix:SphereVisual3D Center="0,0,0" Radius="0.5" />
            <helix:EllipsoidVisual3D Center="3,3,3" RadiusX="2" RadiusY="3" RadiusZ="4" />
            <helix:TextVisual3D Position="1,-1,1" Text="Hello"  Foreground="Aqua" Background="Transparent" UpDirection="0,0,1"  Height="1"/>
        </helix:HelixViewport3D>



If flip in view from backside is transparency not work on other TextVisual3D.


        <helix:HelixViewport3D ZoomExtentsWhenLoaded="True" ShowCoordinateSystem="True"  CameraMode="Inspect">
            <helix:SunLight />
            <helix:GridLinesVisual3D Width="10" Length="10" MinorDistance="1" MajorDistance="1" Thickness="0.01"/>
            <helix:SphereVisual3D Center="0,0,0" Radius="0.5" />
            <helix:EllipsoidVisual3D Center="3,3,3" RadiusX="2" RadiusY="3" RadiusZ="4" />
            <helix:TextVisual3D Position="1,1,1" Text="Hello"  Foreground="Aqua" Background="Transparent" UpDirection="0,0,1"  Height="1"/>
            <helix:TextVisual3D Position="0.5,1.5,1" Text="Hello"  Foreground="Aqua" Background="Transparent" UpDirection="0,0,1"  Height="1"/>
        </helix:HelixViewport3D>



How can i fix it?

regards Mario


WPF
0

helixViewport3D

Anonymous8 2 years ago in Question 0

how can I get rid of the box with the letters U and L in the bottom right corner of helixViewPort3D control? 



WPF
0

HelixViewPort3D: How to Adjust FrameRate

Petar 2013 2 years ago in Question 0

How to improve WPF 3D rendering performance with adjusting FrameRate?

WPF
0

Loading .OBJ 3D files

P S V Ramaraju 2 years ago in Question • updated by anonymous 9 months ago 6

Hello!!! I am using helix tool kit for one of my visual studio project i.e, loading 3D models. With that I am able to successfully load stl files. Is it possible to load 3d .OBJ files?? Thanks in advance.

0

Mobile Music Videos

semih 2 years ago in Question 0

Tubidy video search system is adapted to a kind of music phones. Today, located in one of the most popular applications on the recent practice among the tubidy mp3. Every day thousands of visitors who practice the day to day more and more visitors are witnessing the rise. This practice increases the Fenomenlig especially helping in the best way the download of all videos that have been watched on YouTube. You can download the iOS and easy way to practice your Android device and the application tubidy advantageous side in no time without loss can start to make the best of it.
Tubidy With this application program is now called the mobile device tracks the entire process of achieving the fastest way you will begin to experience the bliss. Whether you want your smartphone or tablet you can also listen to your music without downloading can begin. Look, we are also now many users spend his life listening to music. In fact, most of the time like the music, Tubidy mp3 s starts to keep the path to the Internet to download. To find a reliable music sites will no longer have a secure music listening pleasure with tubidy program because it is not an easy task in the Internet environment is also a chance to live in the most beautiful way. now you want to be able to search for your favorite songs in the program and will have the chance to listen in with peace of mind without any security threats. Using just wanting an extremely simple program that anyone can use seamlessly.

0

Get position of selected model?

B 2 years ago in Question • updated by Basil Paudel 2 years ago 1

Hi, Using the example RectSelection I have a 3d viewport in which I can select my objects, which are BoxVisual3D.

What I need to do, is return the 3d position of the selected object. I have:

  foreach (var model in models)
            {
                var geometryModel = model as GeometryModel3D;
                if (geometryModel != null)
                {
                    geometryModel.Material = geometryModel.BackMaterial = material;

                    
                    //do stuff 
                    UserControl1.Point1Position = model.Transform; 
                    
                    UserControl1.returnPoint.X = model.Transform.Value.M14;
                    UserControl1.returnPoint.Y = geometryModel.Transform.Value.M24;
                    UserControl1.returnPoint.Z = geometryModel.Transform.Value.M34;
                }
            }

But the values always return as 0. (I spawn the box myself, so i know they are not 0.
When I step through, there is a selected object, but the transform reads as all zeros. How can i get the positin of a BoxVisual3D?

Thanks.

Media3D WPF
0

Instancing

Piotr Tofiło 2 years ago in Question 0

Hi guys. I am really impressed by the instancing demo with boxes in SharpDX. I could use it in my project but I need to be able to set color of every box face individually. Does anybody know how should I approach it ? I could do it in WPF version but it looks tricky in this method. As there is a single model that is multiplied it is hard to apply various colors on every face. Any suggestion will be greatly appreciated.

SharpDX
0

What are the best powerbanks in India

Luckily Sharmaj 2 years ago in Question • updated by anonymous 1 year ago 1

Looking for best power bank in India ? You should check out that list to get more detailed overview on powerbanks.


0

Model showing Blue color

saqib 2 years ago in Question • updated by New1User 7 months ago 15

HI i have getting problem in model when i load my 3d model it shows blue color whereas my model has multiple color


here is my code


ModelVisual3D device3D;

private Model3D Display3d(string model)
{
Model3D device = null;
try
{
//Adding a gesture here
viewPort3d.RotateGesture = new MouseGesture(MouseAction.LeftClick);



//// Material material = new DiffuseMaterial(new SolidColorBrush(Colors.MediumOrchid));
// System.Windows.Media.Media3D.Material mat = MaterialHelper.CreateMaterial(
//new SolidColorBrush(Color.FromRgb(255, 255, 255)));
//Import 3D model file



////////////Material m = new DiffuseMaterial(new SolidColorBrush(Color.FromRgb(255,255,255)));




//ModelImporter import = new ModelImporter();
var importer = new HelixToolkit.Wpf.ModelImporter();
var point = importer.Load(model);
//Load the 3D model file
//// import.DefaultMaterial = material;
//////////////////////////////import.DefaultMaterial = m;
GeometryModel3D mode = point.Children[0] as GeometryModel3D;
Material m = new DiffuseMaterial(new SolidColorBrush(Color.FromRgb(255, 255, 255)));
//import.DefaultMaterial = mat;
//mat = import.DefaultMaterial;



//mode.Material = m;



// device = import.Load(model);
importer.DefaultMaterial = m;
device = point;







}
catch (Exception e)
{
// Handle exception in case can not file 3D model
MessageBox.Show("Exception Error : " + e.StackTrace);
}
return device;
}


and xaml code is here


xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:fyp2"
mc:Ignorable="d"
d:DesignHeight="350" d:DesignWidth="525">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="12*"/>
<RowDefinition Height="163*"/>
</Grid.RowDefinitions>



<h:HelixViewport3D x:Name="viewPort3d" ZoomExtentsWhenLoaded="True" Margin="149,10,10,10" Grid.RowSpan="2" >
<!-- Remember to add light to the scene -->



<h:DefaultLights/>
</h:HelixViewport3D>
<ListView x:Name="imageList" HorizontalAlignment="Left" Height="330" Margin="10,10,0,0" VerticalAlignment="Top" Width="134" SelectionChanged="imageList_SelectionChanged" Grid.RowSpan="2"/>



</Grid>