Is there a example of loading a b3d model

About Monkey 2 Forums Monkey 2 Programming Help Is there a example of loading a b3d model

This topic contains 12 replies, has 3 voices, and was last updated by  EdzUp 1 year, 5 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #11631

    EdzUp
    Participant

    As the title suggests is there a example for loading a 3d model.

    I have tried modifying DruggedBunny’s example with the following:

    [/crayon]

    But to no avail, the Quadrill.b3d mesh is attached to this message.

    What am I doing wrong I have been wracking me brains over trying to get a model to load but it wont load any of the Ultimate Unwrap or Milkshape3d exported models I have tried.

    Attachments:
    1. Quadrill.zip
    #11633

    EdzUp
    Participant

    On another note is there a way to actually move Models/Meshes as it appears that it doesn’t have a Move method like the camera does?

    #11636

    DruggedBunny
    Participant

    Not sure if B3D is supported, but Models are Entities that include mesh and texture data (and more), same as Cameras and Lights — meshes are just the model’s mesh data, not Entities.

    They use the same movement/rotation methods as Cameras, Lights and other Entity objects:

    That’s slightly different to Blitz3D, in that models were referred to there as Entities, and now they’re sort of clarified as a separate thing

    It was Lights, Cameras and Models-called-Entities in Blitz3D, despite Lights and Cameras being Entities as well, so this sort of makes more sense!

    Entity is the base class, whereas Lights, Cameras and Models are the objects you’d actually use in practise, which have all the properties of Entities.

    That said, the Entity docs don’t seem to mention Move, Turn, etc, and they don’t appear in the auto-complete either, presumably as a result of whatever makes them missing from the docs!

    #11639

    DruggedBunny
    Participant

    Wait, the docs do mention these, but under mojo3d:mojo3d.graphics -> Extensions, rather than Entity itself, which is really confusing! I guess the editor isn’t taking the extended version into account for autocomplete purposes.

    #11640

    DruggedBunny
    Participant

    Oh, you need to import mojo3d-loaders as well as assimp, see if that works:

    #11643

    EdzUp
    Participant

    ah thanks Druggedbunny will try that tried the loaders first with no success so looked at the assimp files and thought that assimp was all that’s required.

    #11644

    Mark Sibly
    Keymaster

    #Import <"mojo3d-loaders">

    This should be all you need to do to add assimp support to a mojo3d project so you can load b3d, 3ds, x etc.

    The ‘turtles’ test in mojo-loaders/tests/ uses b3d I think.

    I’m currently working on animation stuff so animated entities are properly copied (doesn’t currently work) and some form of ExtractAnimSeq is implemented, possibly via an Animation.Slice(…) method. Should have some b3d animation demos converted soon.

    #11645

    EdzUp
    Participant

    Mark how do we access the move properties of a Entity with cameras it’s just Camera.move but entities don’t seem to have this property?

    #11646

    Mark Sibly
    Keymaster

    As the bunny on drugs mentioned, many of the utility methods such as Move, Rotate are implemented via extensions, which means they’re rather inconveniently located in a separate section of the docs:

    file:///D:/dev/monkey2/docs/modules/mojo3d/module/mojo3d-EntityEXT.html

    Ideally, I want docs to either link to (at least) extensions in the same module from the class docs page, or perhaps even show extensions in the class itself, but that’ll happen ‘later’. For now, I’m concentrating on the coding part, and being able to implemement this util stuff in a separate ‘extensions’ file is very nice.

    I’m not sure why autocomplete isn’t finding them – in fact, it doesn’t seem to be able to find any entity members…will look into it.

    #11647

    EdzUp
    Participant

    Mark thanks for your help on this will get to converting my other code over and see where how it takes shape 🙂

    #11655

    EdzUp
    Participant

    Ship piccy
    Can anyone guess what I am making 😉

    #11658

    Mark Sibly
    Keymaster

    ‘Star Rogue’?

    #11660

    EdzUp
    Participant

    Yup good guess 🙂

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.