none
How can a 3D MODEL be displayed?

    Question

  • F = "False"
    path = "C:\Users\MM\3D Objects\"
    NameFile = "Windmill.3mf"
    FFN = Text.Append(path, NameFile)
    WM = Shapes.AddRectangle(200,200)
    WM3D = LD3DView.LoadModel(WM, FFN)
    LD3DView.AddView(1000, 720, F)

    It do not function. Can evrybody help me?


    Best Regards Martin

    Sunday, April 02, 2017 9:06 AM

Answers

  • This is a bug I just fixed - the speed multiplier wasn't being used for W S Up Down (only mouse wheel), so it was very slow due to large scaling in this model.

    The other difference I added was AutoControl2 where a slightly different interactive control (more for model 'inspection' - I may modify further, rather than moving through a model, 'fly' mode).

    Monday, April 03, 2017 8:58 PM
    Moderator
  • martmen,

    Doesn't look like the LDExtension handles .3mf files yet. If you look at LD3dView.LoadModel it says it will handle the following formats.  Supported formats include 3ds, lwo, obj, objz, stl and off. Maybe you can convert the file "Windmill.3mf" to the 3ds format which will work. Here's a link to a converter program:

     http://nchsoftware.com/3dconverter/index.html

    I haven't tried this, but it says it will convert .3mf to .3ds. It also says free download.


    JR


    Sunday, April 02, 2017 12:57 PM
    Answerer
  • @LitDev

    Indeed, just saw it moving (very slowly). Thx

    @Martin

    Dein obiges Beispiel wäre entsprechend (Basisversion, rein nur zum Laden):

    F = "False"
    T = "True"
    path = "C:\Users\MM\3D Objects\"
    NameFile = "Windmill.3ds"
    FFN = Text.Append(path, NameFile)
    
    ''WM = Shapes.AddRectangle(200,200) 'die Shape in diesem Fall ist die  "View3D#" von 'LD3DView.AddView'
    WM = LD3DView.AddView(1000, 720, F)  'oder (gw,gh, F)  um das GraphicsWindow auszufüllen
    
    LD3DView.AutoControl(T,T, 3000, 100)  '3000 ist die Entfernung Kameraauge-Zentrum (0,0,0) bei Drücken von (Umschalt+) X,Y,Z, 100 die Einzelschrittweite
    
    ' Licht anmachen, sonst ist Dunkelkammer, Grau passt meist für 'AddAmbientLight'
    LICHT = LD3DView.AddAmbientLight(WM, "Gray")
    
    WM3D = LD3DView.LoadModel(WM, FFN)  'WM3D ist ein Array
    
    ' Kameraauge etwas zurückfahren (-3000, da das Modell ziemlich groß ist) für eine halbwegs gute Ansicht
    LD3DView.MoveCamera(WM, 0,0,0, -3000)
    Das geladene Modell ist etwas zerfleddert (Windrad liegt abseits), muß dann noch eingerichtet und das Windrad angepasst werden.

    Monday, April 03, 2017 9:48 PM
    Answerer

All replies

  • martmen,

    Doesn't look like the LDExtension handles .3mf files yet. If you look at LD3dView.LoadModel it says it will handle the following formats.  Supported formats include 3ds, lwo, obj, objz, stl and off. Maybe you can convert the file "Windmill.3mf" to the 3ds format which will work. Here's a link to a converter program:

     http://nchsoftware.com/3dconverter/index.html

    I haven't tried this, but it says it will convert .3mf to .3ds. It also says free download.


    JR


    Sunday, April 02, 2017 12:57 PM
    Answerer
  • About LD3DView.LoadModel, there's a sample in LitDev's \3D-samples\LD3DViewImport.sb  which uses it.

    Seems, the 'windmill.3mf'  is from here sciBASIC/gr/3DEngineTest/3mf/

     The .3mf type is just a (renamed) .zip file (PK) and the containing '3dmodel.model' is an xml-file with vertices, triangles etc.  I found another windmill.3ds  ( DL-Link ) 

     and here's a quick sample ID: LLJ235  to load and use it (needs some refinements).

    PS: There are also some free online converters eg. Online 3D File Converter




    Sunday, April 02, 2017 7:34 PM
    Answerer
  • Pappa Lapub,

    Tried your program but it doesn't work. It says: Can't find Operation ResetMaterial in LD3DView and on another line it says Cannot find Operation GetPosition in LD3DView. So, I went to extensions and reloaded the .dll and .xml files. Are you running a different level that has those functions?


    JR

    Sunday, April 02, 2017 10:39 PM
    Answerer
  • @ JR - These 2 3D commands were added in version 1.2.15.0 (for a 3D rubic cube - added as a 3D sample).

    @ Papa -  Nice use of the 3D methods.

    Monday, April 03, 2017 3:11 PM
    Moderator
  • Sorry for lateness and thanks LitDev.

    @LitDev, Not sure, if 'W,S, Up,Down' keys should work with these AutoControl settings ??

    (I'm using the v1.2.16.0 beta from 27.03.17  20:30)

    Extended a bit to ID: LLJ235-0 with tulips from A-dam randomly around the mill, corrected typo GW.Width -> GW.Height, changed rotation direction to counter clockwise (which i think is more realistic) and viewing upwards to the mill from a lower position.

    (needs a little longer to load)

    PS: Just saw, that there's a new beta v1.2.16 from today, but not tested yet)

    Monday, April 03, 2017 7:52 PM
    Answerer
  • This is a bug I just fixed - the speed multiplier wasn't being used for W S Up Down (only mouse wheel), so it was very slow due to large scaling in this model.

    The other difference I added was AutoControl2 where a slightly different interactive control (more for model 'inspection' - I may modify further, rather than moving through a model, 'fly' mode).

    Monday, April 03, 2017 8:58 PM
    Moderator
  • @LitDev

    Indeed, just saw it moving (very slowly). Thx

    @Martin

    Dein obiges Beispiel wäre entsprechend (Basisversion, rein nur zum Laden):

    F = "False"
    T = "True"
    path = "C:\Users\MM\3D Objects\"
    NameFile = "Windmill.3ds"
    FFN = Text.Append(path, NameFile)
    
    ''WM = Shapes.AddRectangle(200,200) 'die Shape in diesem Fall ist die  "View3D#" von 'LD3DView.AddView'
    WM = LD3DView.AddView(1000, 720, F)  'oder (gw,gh, F)  um das GraphicsWindow auszufüllen
    
    LD3DView.AutoControl(T,T, 3000, 100)  '3000 ist die Entfernung Kameraauge-Zentrum (0,0,0) bei Drücken von (Umschalt+) X,Y,Z, 100 die Einzelschrittweite
    
    ' Licht anmachen, sonst ist Dunkelkammer, Grau passt meist für 'AddAmbientLight'
    LICHT = LD3DView.AddAmbientLight(WM, "Gray")
    
    WM3D = LD3DView.LoadModel(WM, FFN)  'WM3D ist ein Array
    
    ' Kameraauge etwas zurückfahren (-3000, da das Modell ziemlich groß ist) für eine halbwegs gute Ansicht
    LD3DView.MoveCamera(WM, 0,0,0, -3000)
    Das geladene Modell ist etwas zerfleddert (Windrad liegt abseits), muß dann noch eingerichtet und das Windrad angepasst werden.

    Monday, April 03, 2017 9:48 PM
    Answerer
  • Pappa Lapub,

    I know the above was for Martin, but could you also translate to English?

    I was thinking. It would be nice to have a bare minimum 3D sample program to start with. Then maybe one that can be advanced in steps and explained so that users could understand how to use the system.

    Also, I loaded the above, but the windmill is like sideways on the screen and weird looking. I know you were representing fixes to Martin's program, but is that they way it ends up looking?


    JR

    Tuesday, April 04, 2017 11:07 AM
    Answerer