Results 1 to 4 of 4

Thread: M15 alternate input setup, strings instead of file-paths.

  1. #1

    M15 alternate input setup, strings instead of file-paths.

    I am playing around with some ideas, related to direct manipulation of M15 data, but there is a strong limitation of the loading command.

    The loading command accepts a specific "FileName" and expects a specific "ImageDir", which it uses to load the data from files, based on those locations and names.

    This requires a little effort to get models to load, and load correctly under certain situations. (In my case, it is partly due to my 3D program not exporting the desired information needed. File-names have to first be manually entered into the M15 file, and the generic names removed, and the numbers have to be matched to the file names. Quite a task for a 1000 vertex object, with 20 images.)

    My thought was that we could send a raw "String" with the full data of the M15 as the "FileName", while we could also send a raw "String" with a valid image-set (CSV). EG, "image1.bmp, image2.bmp, image3.bmp".

    I was also thinking that a nice function to GET and SET individual "Image-maps" would be another great set of commands. As opposed to trying to cycle through each vector, to see which ones belong to image1, and hope that image1 is "TextureA".

    Ok, last suggestion... If GET and SET are made... The ability to set a TextureIndex from a loaded texture-image would compliment that function real well. That would give the LoadTexture command another justified use, besides only for private-vector creations. That would also go well with the first suggestion, about the CSV, but that would require an array of image indexes, and deem another whole new command-style for loading M15. (So not a suggestion at the moment.)

    The purpose of those commands would be to do something like this...

    LoadM15 (MyDragon1$, {PurpleSkin$, GreenEyes$})
    LoadM15 (MyDragon1$, {GreenSkin$, YellowEyes$})
    LoadM15 (MyDragon2$, {PurpleSkin$, OrangeEyes$})
    LoadM15 (MyDragon2$, {GreenSkin$, BlackEyes$})

    That would normally require 4 separate M15 files, each having the skin-mod in them.

    But, like above, there is only 2 M15 files, and the entire image-sets can be customized at the point of loading. With the second suggested command, we could GET and SET those values, as needed, without another reload of those same four models. Also, without a complex stepping-code to walk through all the vertex points, seeing if it is part of an image that requires a change.

    We would also be able to load one file, store it in memory, and alter data directly, if desired. (Without altering any live-object in memory. Then, load it as a new object if desired, or recycle it by replacing an existing object. That would make cool morphing!)

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: M15 alternate input setup, strings instead of file-paths.

    Hi Jason,

    interesting ideas!
    Did you know, that when working with multiple model entities they can use one model slot, but each entity can have "skin" casted using TBGL_EntitySetTexture?
    Of course, it works only for models with one texture used for whole mesh.

    I will think about the rest, thanks for posting.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: M15 alternate input setup, strings instead of file-paths.

    Hi,

    to load texture from file I use "Load" word in command and to make texture from string I use "Make".
    So ... I think for making model from string, could we agree on TBGL_m15MakeModel command name?


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4

    Re: M15 alternate input setup, strings instead of file-paths.

    Can you set a flag as an optional statement...

    no flag (Default %false) is file load... so the input is the file-name

    if the flag is %true, it is not a file... and is the optional string which contains the file-data.

    TBGL_m15LoadModel (ModelFile/ModelString, TextureDirPath, ModelID, TargetedDisplayList, NormalVectorMethod, IsString)

    TBGL_m15LoadModel (MyFilePath, TextureDirPath, ModelID, TargetedDisplayList, NormalVectorMethod)
    TBGL_m15LoadModel (MyFilePath, TextureDirPath, ModelID, TargetedDisplayList, NormalVectorMethod, %false)

    TBGL_m15LoadModel (MyStringModel, TextureDirPath, ModelID, TargetedDisplayList, NormalVectorMethod, %true)

    A change would be a whole new model, and require a new load... (That "New" model would have the new images inside it.)

    Not sure if hot-swapping of a new model would be "List-safe". But that would allow the single list item to be changed, while not the others in the list.

    This is going to be sweet with the new dynamic types...

Similar Threads

  1. How to Drop a file onto an Input box?
    By dan_moran in forum UI (User Interface)
    Replies: 8
    Last Post: 13-11-2008, 00:33

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •