Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:03
    x1y9 commented #1789
  • 07:58
    x1y9 commented #1789
  • 07:47
    gregorsGit commented #1789
  • 03:05
    holance labeled #1788
  • 03:05
    holance labeled #1788
  • 03:05
    holance closed #1788
  • 01:41
    holance commented #1789
  • 01:40
    holance commented #1789
  • 01:14
    x1y9 commented #1789
  • 00:52
    holance commented #1789
  • 00:14
    x1y9 commented #1789
  • Jun 23 16:04
    holance commented #1789
  • Jun 23 11:19
    x1y9 opened #1789
  • Jun 23 00:13
    holance commented #1788
  • Jun 22 22:13
    ikonuk opened #1788
  • Jun 22 18:38
    holance commented #1787
  • Jun 22 18:32
    ikonuk opened #1787
  • Jun 21 11:45
    victorhyper closed #1786
  • Jun 21 11:45
    victorhyper commented #1786
  • Jun 21 11:02
    victorhyper opened #1786
Lunci
@holance
@thienmenh294 You can create an issue in github upload a sample there.
thienmenh294
@thienmenh294
can I send a email to you?
Fichtelcoder
@FrankenApps
I would like to apply a runtime generated ImageTexture to a Cube. All that I am getting no matter how I tried is a white cube. This is my code. I would greatly appreciate any help or hint to what I am doing wrong.
public MainWindow()
        {
            InitializeComponent();

            Create3DViewPort();
        }

        private void Create3DViewPort()
        {
            var hVp3D = new HelixViewport3D{ 
                ShowFrameRate = true,
                ShowViewCube = true,
                ShowCoordinateSystem = true,
                ShowTriangleCountInfo = true
            };
            var lights = new DefaultLights();
            hVp3D.Children.Add(lights);

            var meshBuilder = new MeshBuilder();
            meshBuilder.AddBox(new Point3D(0, 0, 0.5), 1, 1, 1);

            hVp3D.Items.Add(new MeshGeometryVisual3D
            {
                MeshGeometry = meshBuilder.ToMesh(),
                Fill = GetTextMaterial("T")
            });

            hVp3D.Children.Add(new GridLinesVisual3D
            {
                Width = 8,
                Length = 8,
                MajorDistance = 1,
                MinorDistance = 1,
                Thickness = 0.01
            });

            h3dContainer.Children.Add(hVp3D);
        }

        private System.Windows.Media.Brush GetTextMaterial(string text)
        {
            Bitmap bmp = new Bitmap(64, 64);
            RectangleF rectf = new RectangleF(0, 0, bmp.Width, bmp.Height);

            Graphics g = Graphics.FromImage(bmp);
            g.SmoothingMode = SmoothingMode.AntiAlias;
            g.InterpolationMode = InterpolationMode.HighQualityBicubic;
            g.PixelOffsetMode = PixelOffsetMode.HighQuality;
            g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;

            g.FillRectangle(System.Drawing.Brushes.Green, rectf);

            StringFormat format = new StringFormat()
            {
                Alignment = StringAlignment.Center,
                LineAlignment = StringAlignment.Center
            };

            g.DrawString(text, new Font("Tahoma", 8), System.Drawing.Brushes.Black, rectf, format);
            g.Flush();

            var bmpImage = Bitmap2BitmapImage(bmp);
            var material = MaterialHelper.CreateImageMaterial(bmpImage, 1, true);
            var imageBrush = new ImageBrush(bmpImage);
            return imageBrush;
        }

        private BitmapImage Bitmap2BitmapImage(Bitmap bitmap)
        {
            using (MemoryStream ms = new MemoryStream())
            {
                bitmap.Save(ms, ImageFormat.Png);
                ms.Position = 0;
                BitmapImage bi = new BitmapImage();
                bi.BeginInit();
                bi.StreamSource = ms;
                bi.EndInit();

                return bi;
            }
        }
}
Fichtelcoder
@FrankenApps
I suspect it has to do with the texture coordinates, but still I do not understand why I do not see any green, which I would expect in that case...
Lunci
@holance
@FrankenApps There are several parameters on mesh builder constructor. Make sure you set generate texture coordinate to true
F1e2r
@F1e2r
Hello! I am new to helix toolkit. I use helix toolkit wpf, everything great! And now I want to print HelixViewport3D (on real or PDF printer). I use PrintVisual method of PrintDialog and it works, but quality of image not so good as expected. It seems that wpf print it in wpf's standart 96 dpi, not in 300, 600 or 1200 dpi that I choose in printer settings. Is there any way to set dpi of image rendering for printing? Thanks in advance!
Fichtelcoder
@FrankenApps
sc.png
@holance I did. Sadly I still only see a white surface.
yonghua
@dayang
image.png
yonghua
@dayang
@holance I use ItemModel3D as the code,and FindHits when mouse move,but can only get hit result in last item's points
image.png
image.png
Lunci
@holance
@dayang are you using single point model to render your points? Or use many point model for each point?
@FrankenApps have you verified the bitmap your code rendered?
yonghua
@dayang
@holance My whole model has several hexahedrons, each hexahedron has six surfaces, and each surface uses a PointGeometryModel3D to render many points on it
image.png
This is one hexahedron
I run the OctreeDemo which works well,so maybe the use of ItemsModel3D?
yonghua
@dayang
image.png
My code wirtes like this
redrabbit007
@redrabbit007
Has anyone created a scene designer for helix-toolkit? Where I could visually place lights, models, etc.
Lunci
@holance
@dayang which version are you using?
Are you able to upload a sample to show the issue?
Gravemind2401
@Gravemind2401
if you dispose a group element does it also dispose of all its children? I can see it disposes the group's scene node, but im not sure if child nodes are part of that diposal
Lunci
@holance
@Gravemind2401 yes, all children will be disposed
miquik
@miquik

Hello,

I try to implement my custom shader technique; In order to get it works, every objects in the scene must be preprocessed in this way: object geometry is split in two part, one part (let's called A) has its own shader, vertex/index buffers, primitivetopology, also the other part (let's called B) has its own shader, buffers.

Now, to apply this technique correctly, I have to render A first and the B in this order. This must be done for every objects so, for example, if I have 3 objects in scene I have to render: A1 B1 A2 B2 A3 B3.
How could manage this in Helix? I think about create two nodes (one for A and one for B) and append both as child of an "empty" parent-Object node

kthyholdt
@kthyholdt
Hey, I'm trying to migrate my program to .Net Core, when changing to the Helixtoolkit Core SharpDX packages the append function in MeshBuilder no longer accepts MeshGeometry3D as input. Is there some using I'm forgetting, or was this intentionally removed?
Lunci
@holance
@miquik The easiest way is just use different node to contain different parts. And put them in order.
Lunci
@holance
@kthyholdt You can use the append function and pass in different properties from MeshGeometry3D.
DeshpandeJanhavi
@DeshpandeJanhavi
I want to generate Digitally reconstructed radiograph (DRR) from CT volumetric data using raycasting technique. Is there any way to render 3D volumetric data using raycasting in helix toolkit?
Federico Rossi
@artipo
2020-11-19_14h12_34.png
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?
If needed I can try to provide a test repo.
SnowyWreath
@SnowyWreath
Is there a post effect node like PostEffectMeshBorderHighlight that works against a white background? The PostEffectMeshBorderHighlight node will provide a colored glow that lightens the background, but that has no effect on white. Is there a way to change the blending to darken the background, or to just colorize it?
Gravemind2401
@Gravemind2401
is it possible to set a render distance per element? ie if camera is more than X units away, do not render this specific element
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.