creating 3D models
Hello there
I've been playing with a ship generator script
https://github.com/a1studmuffin/SpaceshipGenerator
got some interesting result in Blender and now I try to import the 3D model in EE
I've follow the 3d models guide on github https://github.com/daid/EmptyEpsilon/wiki/Adding-3D-models
but EE crash every time the ship should be visible, can't find an explicit message about
I'm totally newbie in 3D stuff...
I have many question regarding this topic
* when I export the blender result in .obj, if I follow export option from the github wiki, I don't get any texture image. else, if I tick write material and change path mode to copy, I get the texture file
What is the right way to proceed ?
* the files I get from obj export don't have the same names. for ex. I have a mytest.obj file and hull_xxxxx.png files for texture. I've tried to rename them, but no luck
Is there a hard link in the obj file to names of the png texture files ?
* in the model_data.lua file, which lines are mandatory ?
model = ModelData()
model:setName("mytest")
model:setMesh("mytest2.obj")
model:setTexture("hull_normal.png")
model:setSpecular("hull_lights_diffuse.png")
model:setIllumination("hull_lights_emit.png")
model:setScale(24) model:setRadius(520)
I've tried several options, EE still crashing in the main screen view
* how setScale() should be use.calculate regarding the size of the model ?
* can it be an issue about the number of polygon in the obj file ?
Thx !
I've been playing with a ship generator script
https://github.com/a1studmuffin/SpaceshipGenerator
got some interesting result in Blender and now I try to import the 3D model in EE
I've follow the 3d models guide on github https://github.com/daid/EmptyEpsilon/wiki/Adding-3D-models
but EE crash every time the ship should be visible, can't find an explicit message about
I'm totally newbie in 3D stuff...
I have many question regarding this topic
* when I export the blender result in .obj, if I follow export option from the github wiki, I don't get any texture image. else, if I tick write material and change path mode to copy, I get the texture file
What is the right way to proceed ?
* the files I get from obj export don't have the same names. for ex. I have a mytest.obj file and hull_xxxxx.png files for texture. I've tried to rename them, but no luck
Is there a hard link in the obj file to names of the png texture files ?
* in the model_data.lua file, which lines are mandatory ?
model = ModelData()
model:setName("mytest")
model:setMesh("mytest2.obj")
model:setTexture("hull_normal.png")
model:setSpecular("hull_lights_diffuse.png")
model:setIllumination("hull_lights_emit.png")
model:setScale(24) model:setRadius(520)
I've tried several options, EE still crashing in the main screen view
* how setScale() should be use.calculate regarding the size of the model ?
* can it be an issue about the number of polygon in the obj file ?
Thx !
Comments
Parameter "camera_position" not found in shader
any ideas anyone?
Edit: Nevermind, probably not related.
I have had heavy polygon objects take forever to load or crash.
Last I remember you should only need the first 4 lines, not sure on the scale, haven't messed with it since the recent updates.
same crash
here a link with report file, and the model file. maybe it can be usefull to debug
https://drive.google.com/file/d/187pV4_YaeHa-Jlsr1po6di_UmgJ4BD_M/view?usp=sharing
bridgesim.net/discussion/225/random-spaceship-model-generation-script-for-blender
I will try to follow instructions this WE
The obj files are simple text files, check if the lines that start with "f" look like this: "f 1/1/1 2/2/2 3/3/3" They should have 9 numbers per "f", if any of the numbers are missing, EE handles this badly and crashes. If any of the numbers are 0, EE crashes... (sorry )
new related questions are
* what is the purpose of setSpecular and setIllumination ?
* EE allow us to rotate the models on one axis. Can we manage the 2 others axis directly in EE, without modify the model in blender ?
* int he same way, can I manage the position of one objects in the 3D space ? something like the Z coordinate I guess
It might also help if you post the corresponding lines in model.lua.
setSpecular sets a specular texture map, lighter areas are more reflective. Quite common in advanced 3D models. But my shader doesn't work very well, so the effect is limited.
setIllumination sets a texture that is always a 100% lit, without light influence. Everything that is black is ignored. This effect is quite profound. The stations use it to have the windows always lit. The ships use it to have the engine and lights always lit no matter the rotation.
(See the ammo-box as example, this has a small keypad that is always lit. Most likely not visible in game, but that's how it came with the textures)
You can leave all these out, the game will just not use them. No need to provide placeholders or empty textures.
copy your .obj and texture file in /ressources/ directory
you may use a subdirectoy here if you want to
in /scripts/model_data.lua file
add those lines
model = ModelData()
model:setName("myModel")
model:setMesh("myObjFile.obj")
model:setTexture("myTextureFile.jpg")
model:setScale(20)
model:setRadius(50)
As BluShadow pointed it, the .obj and .jpg files should be directly in ressources directory. if you use a subdirectoty, add it like this
model:setName("mySubDirectory\myModel")
you can play with scale to make the model appears bigger, and the radius to change the icon size in radar views
then, add a ship template in a template file, here for a frigate
in /scripts/shipTemplates_Frigates.lua file
template = ShipTemplate():setName("MY SHIP"):setClass("Frigate"):setModel("myModel")
template:setDescription([[some text for a description.]])
template:setHull(100)
setModel() should use the setName define in model_data.lua
then, you should see your ship in main screen. each time I changed a model file or template file, I completly restarts EE to make sure the news definition are load.
Selfmade Models take like 20 to 60 seconds to "load on Visuals". So if i spawn a selfmade Model with the GM-Screen, the Mainscreen needs about that time to load the model and is frozen for this period of time. Same counts for the Science Database.
Any idea how to "preload" the Models like the rest of the models?