Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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
  • May 02 19:14
    holance commented #1748
  • May 02 12:19
    lovefri commented #1748
  • May 02 11:07
    holance commented #1748
  • May 02 11:07
    holance commented #1748
  • May 02 11:06
    holance commented #1748
  • May 02 09:53
    lovefri opened #1748
  • Apr 30 22:44

    holance on 2.21.0

    (compare)

  • Apr 22 13:04
    holance closed #1403
  • Apr 22 07:43
    lovefri commented #1403
  • Apr 22 07:23
    holance commented #1403
  • Apr 22 07:21
    holance commented #1403
  • Apr 22 07:19
    holance commented #1403
Gravemind2401
@Gravemind2401
im hoping to increase performance by not rendering a lot of smaller objects past a certain distance
Lunci
@holance
@SnowyWreath You can try to set the highlight color to dark color
@Gravemind2401 You can set far field distance
Gravemind2401
@Gravemind2401
isnt the far plane global? or is far field a different thing to far plane? basically i want to have my smaller objects culled at a shorter distance than my larger objects because i have a very large range of object sizes in the scene
for example a small object may be far away enough that it can be culled, but there could be a large object further back which is still visible
Lunci
@holance
Camera is doing frustum test, as long as large objects are still inside or intersect with the frustum, they will be rendered.
@Gravemind2401
Gravemind2401
@Gravemind2401
i thought the far plane is what determines the length of the frustrum and hence anything beyond the far plane will not render
Gravemind2401
@Gravemind2401
basically i have a gigantic 3D skybox, then ground/buildings, then smaller detail objects
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!