Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 20 16:08
    holance commented #1752
  • May 20 07:35
    tqmitaca opened #1752
  • May 20 01:59
    brucek5 commented #1751
  • May 20 00:09
    holance commented #1751
  • May 19 22:58
    brucek5 opened #1751
  • May 19 16:40
    holance commented #1750
  • May 19 16:40
    holance commented #1750
  • May 19 15:44
    alextoind commented #1750
  • May 19 15:44
    alextoind closed #1750
  • May 19 15:44
    alextoind commented #1750
  • May 19 15:23
    holance commented #1750
  • May 19 15:03
    alextoind opened #1750
  • May 06 09:08
    KillSwitch607 closed #1749
  • May 06 09:08
    KillSwitch607 commented #1749
  • May 06 07:03
    KillSwitch607 opened #1749
  • May 04 04:55
    holance commented #1748
  • May 04 04:55
    holance commented #1748
  • May 04 04:55
    holance closed #1748
  • May 04 04:55
    holance commented #1748
  • May 03 09:08
    lovefri commented #1748
Gravemind2401
@Gravemind2401
i want each of them to have their own “render distance”
ideally i would give each their own frustrum, because having a skybox and small objects in the same view sacrifices a lot of z order precision so i get lots of z fighting
Tai Le
@atlesg

@atlesg There are many books talked about 3d math and rendering. Once you understand the basics, it will be beneficial to learn helix toolkit or other game engine as well.

Thank you so much Sir! I'm gonna have a read soon

ChengdaGuo
@ChengdaGuo
image.png
Hi everyone. I loaded a ply file and use VertColorMaterial to render it. But I thought the whole mesh is too bright like below shows. So I try to change the colors of AmbientLight3D and DirectionalLight3D to darken the whole mesh. But it not work, can I do that and what approach do you recommend?
Lunci
@holance
@Gravemind2401 You need to tune the depth bias to avoid z fighting.
@ChengdaGuo Try to remove the AmbientLight3D or set it to near black.
ChengdaGuo
@ChengdaGuo
@ I've already tried! I found that change AmbientLight3D or DirectionalLight3D didn't take effect. Even I removed the settings of Lights from xaml, the render effect is also unchanged.
@holance
Tai Le
@atlesg

alt

Hi everyone, I loaded a low-polygon STL model into my viewport. Now I want to highlight any facet of the model whenever my mouse cursor hovers on the surface → After that, I want to get that facet's information such as: normal vector, center's position... I don't know what to do now. Here is part of my code so far:

 private void viewPort3D_MouseMove(object sender, MouseEventArgs e)
        {
            findFacet();
        }
void findFacet()
        {
            Vector3D vector3D;
            var mousePosition = Mouse.GetPosition(viewPort3D);
            var source = FindSource(mousePosition, out vector3D); // Return Model3D
        }
 Model3D FindSource(Point point, out Vector3D normalVector)
        {
            var hits = Viewport3DHelper.FindHits(viewPort3D.Viewport, point);
            foreach (var hit in hits)
            {
                if (hit.Model == our_model3D)
                    continue;
                normalVector = hit.Normal;                
                Console.WriteLine("normalVector: " + normalVector.ToString());
                return hit.Model;                
            }
            normalVector = new Vector3D();
            return null;
        }

Thank you!

SnowyWreath
@SnowyWreath
@holance, I tried PostEffectMeshBorderHighlight with a dark color, but it still didn't show up on a white viewport background. The highlight only becomes visible when something darker moves behind it.
Lunci
@holance
@ChengdaGuo VertColorMaterial does not have any light calculating. It purely renders the vertex color. To use lighting calculation, use PhoneMaterial and set VertexColorBlendingFactor = 1.
Lunci
@holance
@SnowyWreath Could you submit a bug in the https://github.com/helix-toolkit/helix-toolkit/issues. This is caused by the blending factor.
@atlesg You need a separate model to render your highlighted triangles. Just create a different mesh model and create your geometry you want to highlight on the fly.
Tai Le
@atlesg

@atlesg You need a separate model to render your highlighted triangles. Just create a different mesh model and create your geometry you want to highlight on the fly.

I see, but how can I get the clicked triangle? The only info I can get now is position of Rayhit, normals, and triangle indices. I mean I need to return 3 points of the facet when event MouseDown happens, how can I seize that info? Thank you

Lunci
@holance
you can get your triangle from the triangle indices, right?
@atlesg
Tai Le
@atlesg
you can get your triangle from the triangle indices, right?
At the moment I don't know how to do that :( I have list of vertexes like: 0.151,0.8965,0.861 and indices like: 1 2 3 4 5... 768, but how can I get the triangle? Is there any method to do that or I must write the algorithm myself?
Lunci
@holance
you don't need algorithm
get the vertices position with the triangle indices from your hit test. Basically like p1 = Positions[index1]; p2 = Positions[index2]; p3 = Positions[index3].
Then create a new mesh with these vertices, and create your triangle vertices array with Indices = new Int32Collection(){0, 1, 2};.
@atlesg
Or simply reuse previous mesh Positions and create a Indices = new Int32Collection(){index1, index2, index3};
Tai Le
@atlesg

get the vertices position with the triangle indices from your hit test. Basically like p1 = Positions[index1]; p2 = Positions[index2]; p3 = Positions[index3].

Thank you Sir, let me code this down real quick, get the result and go back to you!

Lunci
@holance
@SnowyWreath Never mind, I created the bug and push out the fix. Should be available in nightly build.
ChengdaGuo
@ChengdaGuo
@holance Thanks a lot! Perfect solution to my issue!
Lunci
@holance
@atlesg You need the triangle indices from the hit
Tai Le
@atlesg

@atlesg You need the triangle indices from the hit

Thank you, I have successfully seized these 3 points. Now it's time to build a triangle mesh :D

Lunci
@holance

@artipo

Hi, I was trying to add a custom ViewCube to my viewport, without sucess.
Following CustomViewCuboDemo I've added a 'ScreenSpacedGroup3D' to my 'Viewport3DX' (The project uses 'HelixToolkit.SharpDX.Core.Wpf').
If I set ScreenSpacedGroup3D's content as in the demo, everything works.
In my attemps I tried to set ScreenSpacedGroup3D's content via nodes systems as in image above.
ViewCubeNode is structured like this:
'GroupNode' containing 3 'LineNode', one for each axis.
Sadly the ViewCube don't appear where it should, but instead in the main scene, with all the other nodes.
Any ideas?

Currently the ScreenSpacedGroup3D only supports one layer of children. I will need to figure out a way to support multiple layers.

Federico Rossi
@artipo
@holance I admit I do not understand what you meant. Anyway I'll try to go without the use of SceneNodes.
Lunci
@holance
@artipo Basically you can't use group node under screen space node.
Federico Rossi
@artipo
Ok, clear enough :D I'll try to use Element3Ds directly on xaml then. Thank you very much!
Federico Rossi
@artipo
@holance Ok, i changed my custom ViewCube setup as in image
2020-11-27_14h49_54.png
2020-11-27_14h51_51.png
My problem now it's that i can't get Mouse3DDown to working. I am missing something? Is it not possible to hitTest a billboard?
Another question, is it possible to change ScreenSpacedGroup3D's default camera? I would like to try an orthogonal camera instead.
Lunci
@holance
@artipo Currently billboard does not support hit test in screen space group yet. Will need some time to implement the hit test for it.
13134423523
@13134423523
Hope to get your answer @ Gravemind2401
@Gravemind2401 You need to tune the depth bias to avoid z fighting.
Hello, I'm using the component process of Gis to load Google maps section of ellipsoid, the different layers of the biopsy, after treatment, the depth of the calculated error problem may cause the depth buffer, through access to information, I found that you can use the logarithmic depth buffer, to adjust the depth to solve this problem, but I did not found in the components of the depth of description, the position of the sources are vec4, but the position of the component is vec3, so what is the component of the depth of the attribute name?
Where is the depth of the model stored?
Federico Rossi
@artipo

@artipo Currently billboard does not support hit test in screen space group yet. Will need some time to implement the hit test for it.

Perfect, thank you for the info!

Timur Kelman
@TymurGubayev
Is there a way to set or measure the size of a SpatialTextItem? I'm trying to make something like a chess board in 3d -- which will be completely flat -- and put a custom text in each tile of the board. The TextDemo gives a general idea how to do that, and I can control the height of the text shapes via TextGroupVisual3D.Height, but I can't figure out how do I control the width too (I'd want the text to scale to best fit a tile).
kthyholdt
@kthyholdt
Is there some way I can subscribe to changes in Visibility for Element3D objects in code behind? Seems a bit complicated with the DependencyProperties.
Lunci
@holance
@kthyholdt There's a Visible Changed event in scene node you can hook up.
SwaroopSomanna
@SwaroopSomanna
Ive added "helix-toolkit-wpf-SharpDX" to my project and I'm trying to use a viewport3DX. I've added lights and camera to my viewport but the viewport is showing a blank black screen. I've not added any effects manager to my Viewport3DX. Is it necessary to add an effects manager to the viewport for the viewport to work and display models? If yes how do I add an effects manager to a viewport 3DX?
SwaroopSomanna
@SwaroopSomanna
Ok so I've added default effects manager as shown below:
SwaroopSomanna
@SwaroopSomanna
And it's still showing blank screen
SwaroopSomanna
@SwaroopSomanna
A blank black screen
SwaroopSomanna
@SwaroopSomanna
Ok now the viewport is working during runtime but in the designer it stays blank black