Converting LDraw parts to WPF


RE: Converting LDraw parts to WPF
#7
(2019-08-12, 13:09)Victor Di Rienzo Wrote: Van you make a tutorial how you make them?
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!
Reply
« Next Oldest | Next Newest »



Messages In This Thread
RE: Converting LDraw parts to WPF - by Hans de Lang - 2019-08-13, 22:27

Forum Jump:


Users browsing this thread: 1 Guest(s)