In BAM since version v.1.4-162.
Introduction.--------------------
BAM can display on table own 3D models. That models are not part of FP table.
3D model should be in one dir with textures used by model.
Few 3D formats are supported.
ModelImporter.----------------------
In BAM dir you will find simple tool: ModelImporter.exe. Run it. Look at panel on right.
1. From combobox select draw method:
- BAM_diffuse_normal - for models without animation. They may use normal maps, but don't have to.
- BAM_anim_diffuse_normal - as above but for models with animation.
- BAM_hero - for models from DOTA2 (without animation, not finished).
2. Press button "Open Model" and select model.
If you see now your model with loaded textures when all will work in FP. Just press "Save as TGA" button.
If model is not loaded or something is missing, try to save model in different format.
In ModelImporter you can change drawning params. Try it. It will not explode.
Additional info:
- with WASD you can move model
- when you press F11 you can with mouse change direction (like in FP). Press F11 again to turn it off
- when you press F10 model will be displayed as wireframe (like in FP).
- if you lost, press R. It will center model on screen.
- model can be build from many parts. For example "bob" have 6 parts. Each part can have own textures. Model is imported as whole object.
Model is saved as TGA. As you know TGA is texture format. It has one nice feature: you can add any amount of data at end of file (as metadata).
So that TGA file is simple 1 pixel texture with all data about model stored as meta-data at end of file.
Inside that file there is: 3d model, textures, model animations.
Add model to FP.------------------------
Now you need to add created model to table in FP Editor. So:
1. Open table and open Texture Manager.
2. Press Import button and load TGA file created with ModelImporter and load TGA file.
3. Remember name of that "texture".
4. Close Texture Managaer.
5. SAVE TABLE. IT IS IMPORTANT. DON'T FORGET TO SAVE TABLE AFTER YOU ADD CUSTOM MODEL.
Display custom model on table. Command: CreateModel--------------------------------------------------------------------
All custom-models are displayed on table with script commands, not in FP editor. So time to open script editor.
Simplest command to display custom object on table:
xBAM.CreateModel("name-from-texture-manager", x, y, z)If you only add this command and run table (press F5) you can go to "DEV Options" and "Custom Models" menu and change model params.
Full list of params for CreateModel:
xBAM.CreateModel(
"name-from-texture-manager",
X, Y, Z,
Height,
RX, RY, RZ,
ReflectionFlag,
SwapZ2YFlag)- X, Y, Z - coords from FP editor. Note, you can use objects from FP Editor as reference, like this:
xBAM.CreateModel("something", Light1.X, Light1.Y+100, 0)- Height - dimmension on Z axis of object in FP world. If you don't set it, BAM will gues value
- RX, RY, RZ - rotation on X, Y, Z axis, default is 0,0,0
- ReflectionFlag - True or False. Default is True
- SwapZ2YFlag - sometimes 3D model is designed with Y axis used as "up". You can set this flag to True. Same flag is in ModelImporter. Try it to understand it. Default is False.
This function will return "CustomModelObject". To change params later you will use this command like this:
Code:
Dim Starship
Set Starship = xBAM.CreateModel("starship", 100, 100, 0, 100)
This way you will have access to object properties.
[ToDo: more on custom object params.]