Converting LDraw parts to WPF


RE: Converting LDraw parts to WPF
#8
(2019-08-13, 22:27)Hans de Lang Wrote: pretty long story i'm afraidSmile
What you can do is placing an elementhost on a standard form, connect a grid to that and you can use wpf
so
form
  Elementhost
    Grid
      Viewport3D
         Camera
         ModelVisual3D
            Model3DGroup
                Model3D
                   TransFormGroup
                   MaterialGroup
                   MeshData
                       Positions
                       Normals (not given by LDraw but you can leave them out
                       Texturecoordinates ( very useful for stickers )
                       Triangles ( and that's the CCW and CW choice)

Parsing the .dat files is easy. Then calculating the points with the matrixes and put them into the Mesh.positions
Thing is WPF works with Y axis up and LDraw with Y-axis down but if you make Y = -Y and Z = - Z then its normal again
You can't draw edges in WPF, but I scale my bricks to the real measures of 7.8 x 7.8 mm
That give's a small gap between the bricks and shows not as a solid wall
Succes!
Do you think you can make a dll out of this that can be used in my visual basic applications as the renderer for ldraw files, so I can show the result in a picture frame and/or window? Currently I use ldview.dll, but that is 32bit and not 64bit.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
RE: Converting LDraw parts to WPF - by Michael Heidemann - 2019-09-14, 6:25

Forum Jump:


Users browsing this thread: 1 Guest(s)