modeling for pioneer

Pioneer is an open-ended space adventure game. Explore the galaxy, make your fortune trading between systems, or work for the various factions fighting for power, freedom or self-determination.
Homepage: http://pioneerspacesim.net/
IRC: http://pioneerspacesim.net/irc
Downloads: https://pioneerspacesim.net/page/download/
s2odan
Private
Posts: 1212
Joined: Sun Mar 22, 2009 9:50 pm

RE: modeling for pioneer

Post by s2odan »

Thanks dude, I'll try as you suggested.EDIT//*crap removed*As far as I can tell there is something wrong with my model. Its acting very weird in the game.For example, I can fly the ship using your script(potsmoke) but the ship is backwards, if I turn the ship around in the script then I can no longer fly it in the game. (It crashes). very weird.
Potsmoke66
Private
Posts: 1815
Joined: Sun Nov 27, 2016 2:43 pm

RE: modeling for pioneer

Post by Potsmoke66 »

that is truely weird, if you turn the model around it works?drive class 3?export options shouldn't matter much,anyways to make life a bit easier for me i altered the .obj export script for pioneer, so you don't have to set the options each time.pioneer_obj.pymaterials are not needet (.mat), but still supported, you can use the .mat file together with the .obj like in the cobra3 script, texture and material is then allready given.but if you have a model exported with materials selected you need the .mat together with the .obj.check both files in wordpad if the materials that are assigned are the same as in the .mat material list, sometimes blender exports them "wrong" (if a object is joined by two meshes, i.e. and the .blend file is not yet saved and reloadet, whicht helps to assign the right materials and textures for "real").cobra mk3 "old" release (the actual is a bit different)
Code:
define_model('cobra_mk3', { info = { lod_pixels = { 50, 100, 200, 0 }, bounding_radius = 100, materials = {'thrusters', 'text'}, tags = {'ship'}, ship_defs = { { 'Cobra Mk III', { 2*10^7,-2*10^7,1*10^7,-1*10^7,-1*10^7,1*10^7 }, 4*10^7, { { v(0,-0.5,0), v(0,0,-1) }, { v(0,-0.5,0), v(0,0,1) }, }, { 90, 1, 2, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, 90, 100, 16000000, 1 } } }, static = function(lod) load_obj('cobra3_redux.obj', Matrix.new(v(45,0,0),v(0,45,0),v(0,0,45)) * Matrix.new(v(-1,0,0),v(0,1,0),v(0,0,-1))) set_material('thrusters', .30, .30, .30,1, .30, .30, .30, 20) use_material('thrusters') local vBackThruster = v(8, 0.7, 14.5) -- last number is how far back down the ship it is local vFrontThruster = v(3.5, -1.0, -5.0) xref_thruster(vBackThruster, v(0,0,1), 30, true) xref_thruster(vFrontThruster, v(0,0,-1), 20, true) local TopThrust1 = v(-9.0, 1.5, 11.0) local TopThrust2 = v(9.0, 1.5, 11.0) local TopThrustForward = v(0.0, 1.5, -11.0) local BottomThrust1 = v(-9.0, -0.5, 10.0) local BottomThrust2 = v(9.0, -0.5, 10.0) local BottomThrustForward = v(0.0, -0.5, -10.0) thruster(TopThrust1, v(0,1,0), 15) thruster(TopThrust2, v(0,1,0), 15) thruster(TopThrustForward, v(0,1,0), 15) thruster(BottomThrust1, v(0,-1,0), 15) thruster(BottomThrust2, v(0,-1,0), 15) thruster(BottomThrustForward, v(0,-1,0), 15) local LeftBackThruster = v(-18.0, 0.0, 10.0) local LeftForwardThruster = v(-3.5, 0.0, -10.0) local RightBackThruster = v(18.0, 0.0, 10.0) local RightForwardThruster = v(3.5, 0.0, -10.0) thruster(LeftBackThruster, v(-1,0,0), 15) thruster(LeftForwardThruster, v(-1,0,0), 15) thruster(RightBackThruster, v(1,0,0), 15) thruster(RightForwardThruster, v(1,0,0), 15) end, dynamic = function(lod) if get_arg(0) ~= 0 then -- lights on wingtips local lightphase = math.fmod(get_arg(1), 1) if lightphase > .9 then billboard('smoke.png', 10, v(1,1,1), { v(-29, 0, 14) }) elseif lightphase > .8 then billboard('smoke.png', 10, v(1,1,1), { v(29, 0, 14) }) -- middle number is how high vertically on the ship end -- wheels local v73 = v(0.0, -1.0, -5.5) local v74 = v(-4.5, -4.5, 10.5) local v75 = v(4.5, -4.5, 10.5) zbias(1, v73, v(0,-1,0)) -- nose wheel call_model('nosewheelunit', v73, v(-1,0,0), v(0,-1,0), 1.2) zbias(1, v74, v(0,-1,0)) -- rear wheels call_model('nosewheelunit', v74, v(-1,0,0), v(0,-1,0), .64) call_model('nosewheelunit', v75, v(-1,0,0), v(0,-1,0), .64) zbias(0) end end})
since that i'm happy i havn't to use the .mat files for pioneer anymore :) the cobras are good examples of a easy .obj use cobra mk1
s2odan
Private
Posts: 1212
Joined: Sun Mar 22, 2009 9:50 pm

RE: modeling for pioneer

Post by s2odan »

Thanks again for your help.
potsmoke66 wrote:
that is truely weird, if you turn the model around it works?drive class 3?
Yes, weird eh... I've obviously messed up somewhere :) I thought it might be the model, so I went ahead and remade it and also optimized it so its much smaller as well as removing the materials and associated texture, and also changed the .lua script on your advice but its still crashing when I try to buy the ship.If I replace my model with any model from the game, then the ship file loads, its only when I use my crappy model that it crashes... :xIve attached the model, if you have some time maybe you could have a look?edit/ I made this model using the Planemaker for X-plane hehe, then converted it using blender scripts, so maybe that is where the problem lies.... Although if you look at the model file, you will see it looks the same as a 'normal' one. I'm stumped :?:
Potsmoke66
Private
Posts: 1815
Joined: Sun Nov 27, 2016 2:43 pm

RE: modeling for pioneer

Post by Potsmoke66 »

i have no exact answer for thatonly that when i split the model into 4 parts then 3 are working,one is left works alone but not with the restcould be the size of the part which exceeds 1000polys, even when i didn't think that should be a problembut maybe try to split the model up and see which part or how they workedit:it won't, could be simply to oversized, maybe if you split the model and load the parts into separate sub_models.but it's a bit a riddleon the other hand i know there are some problems .obj related, that's why i try to script all by now.somehow the object meshes give trouble in pioneer, but it's not to clear.
s2odan
Private
Posts: 1212
Joined: Sun Mar 22, 2009 9:50 pm

RE: modeling for pioneer

Post by s2odan »

Thanks for looking at the model for me Potsmoker, I will try that what you suggested later on. Last night I was angry with that model, so I decided to make a totally new one from scratch using blender and smax, with none of the problems that the other model had.The new model works with almost no problems now...So I have yet another question, I hope you don't mind...:)In the pics below you can see in blender the texture is applied correctly, but in the game the texture is mis-alligned and its the same in a model viewer I have (3d model viewer), do you have any idea why that is?[attachment=169:Untitled.jpg][attachment=170:pioneer-msvc-9 2010-09-09 16-56-04-57.jpg][attachment=171:pioneer-msvc-9 2010-09-09 16-55-45-19.jpg]
User avatar
Geraldine
Private
Posts: 3454
Joined: Fri Nov 25, 2016 9:12 pm

RE: modeling for pioneer

Post by Geraldine »

A good start s20dan! :) Very "Panther" like! Keep at it!
s2odan
Private
Posts: 1212
Joined: Sun Mar 22, 2009 9:50 pm

RE: modeling for pioneer

Post by s2odan »

Thanks, Geraldine.Hopefully someone on here knows a bit more than me (shouldnt be hard hehe) and can help with the texture problem :)EDIT//Been messing around in blender again, heres a render of the ship:[attachment=172:render1.jpg]Wonder if they could be made to look like that in the game? :)[attachment=173:render2.jpg]
s2odan
Private
Posts: 1212
Joined: Sun Mar 22, 2009 9:50 pm

RE: modeling for pioneer

Post by s2odan »

Heres another model, supposed to be a boa freighter :)[attachment=174:pioneer-msvc-9 2010-09-09 21-18-35-85.jpg]
s2odan
Private
Posts: 1212
Joined: Sun Mar 22, 2009 9:50 pm

RE: modeling for pioneer

Post by s2odan »

Thanks, Farcodev :)another pic, but still without textures:[attachment=177:pioneer-msvc-9 2010-09-09 23-32-11-22.jpg]
s2odan
Private
Posts: 1212
Joined: Sun Mar 22, 2009 9:50 pm

RE: modeling for pioneer

Post by s2odan »

Finally.. Textures...Turns out all my texture co-ordinates were being saved upside down, so I just flipped the images over vertically and it worked :)[attachment=181:pioneer-msvc-9 2010-09-10 03-14-47-03.jpg][attachment=182:pioneer-msvc-9 2010-09-10 03-28-53-27.jpg][attachment=183:pioneer-msvc-9 2010-09-10 03-21-48-15.jpg]
Potsmoke66
Private
Posts: 1815
Joined: Sun Nov 27, 2016 2:43 pm

RE: modeling for pioneer

Post by Potsmoke66 »

yes, textures have to be flipped vertically, i guess mainly because blender is lefthanded and pioneer is righthanded.the "smear" that is on the texture of the panther happens when you break (island) a texture of a smoothened surface.the vertices of the model are then united and you pull the vectors of the texture over the image, i hate that, even if it's logical, other programs aren't that sensible to that.i tried some to evade that (seams, pin) but it only works for blender (of course), the .obj file don't preserves such information (very basic type of mesh, vectors, normals, uv, poly's and smoothing off or on, that's all). solution, split the eges where texture is cut (sad shit), or try to use a seamless texture mapping (hard to achieve, maybe texture it in blender and create a "seamless" rendered texture from it? somwhere of course the tex have to be split off, but if it's on a hard edge, no problem).so texture mapping top side should be seamless to have a correct reproduction in the game (if it's a soft edge), worst is when the texture is tiled and turned 90° what is a common way to tile the space of the map (so done for my adder, again even if i know the fact since the first .obj model, "XWA-Preybird", i did for Pioneer).maybe the use of the .mat file could be a help since the mesh's texture info is stored there and the related material is stored in the .obj file at proper position between the poly's, so it's possible then to have two materials (and textures) in one object, when they are stored correctly in the .obj file, it could work, but .mat must then be used together with the .obj file and texture doesn't have to be applied in the script then.i guess then it should be possible to "island" a texture in a separate map and the uv vectors can't "smear" over the map, because there is no.i haven't tried that yet, maybe it's worth to findout, because i really don't like to split a edge when you feel it should be soft.great ship models, i like the "leather poach", :lol: no really, the boa looks very agressive, cool 8-)
s2odan
Private
Posts: 1212
Joined: Sun Mar 22, 2009 9:50 pm

RE: modeling for pioneer

Post by s2odan »

Thanks :)Yeah the smearing and texture seams are very annoyingIts quite bad on the boa here:[attachment=184:modelviewer-msvc-9 2010-09-10 05-07-45-95.jpg][attachment=185:modelviewer-msvc-9 2010-09-10 05-07-36-46.jpg]The white line on the bottom and the lines on the back seem to come from nowhere, as there is no white on the texture...I'll try and fix it tomorrow, but bed for now :)
Potsmoke66
Private
Posts: 1815
Joined: Sun Nov 27, 2016 2:43 pm

RE: modeling for pioneer

Post by Potsmoke66 »

i will check my adder, and see if i can workaround that using the .mat file, but not before noon ;) if i didn't succeed you still can split the edges where the texture seams areor vice versa, make texture seams where the splitted edges are....no, i can't find a pic of the adder with smeared textures, sad i wanted to show the difference after i split the relevant edges, it's not as hard to look at as i thought before i did it.
Potsmoke66
Private
Posts: 1815
Joined: Sun Nov 27, 2016 2:43 pm

RE: modeling for pioneer

Post by Potsmoke66 »

no, it was no successdue to whatever, the vectors of a smoothened body get pulled over the map even when you split up the texture and use the .mat file to assign the texture to the mesh (not object).[attachment=193:2010-09-11_114911.jpg]but it was worth a try, now i know that there is only one way to evade the "smear", splitted vertices (or edges).else the joined vertice get's allways pulled over the whole map, even when the texture is split up for each meshs uv.anyway this method didn't allows to use different sized textures for the lod, these you can only assign in the script.doesn't mind, it was just a test to see if that would work, it hasn't.but that means mapping and splitting of edges has to be planned carefully. when you respect that from start on it's easier neither to rework a fully smoothened body.i remember the troubles uncle bobs lanner gave me, many parts i had to split from the original object to evade that,he just pulled the uv enywhere sometimes to get a certain part remapped. i guess .x and other formats are less sensible to that rather .obj. might be they use separate vectors for the uv, while .obj uses the uv vectors linked to the vertices.so that when a vertice is unified it will have unified vectors for uv to.i'm not shure if there is a way to work around that, but i guess there should be a way, because the uv vectors are stored separately in the .obj file, only thing is manage it to get them splitted when a vertice is unified. but i can't say if it's possible at all, maybe they are really linked to the vertices..x files as example, store a extra vertice list, which i guess is exactly for this, to separate (or add) uv vectors from (to) vertice vectors. or separate normals from vertices so a vertice can be split but normals stay unified, but in the end the result is the same.that brings up a idea, i know you can't separate normals from vertices in blender, but other programs like my old z-modeler they do, you can unify (split, rotate, strech) the normals no matter if the vertice is unified or split.in the very beginning i found blenders way to manage the normals annoying and there is a disadvantege to that, you simply can't separate the normals from the vertices.sadly the free version (1.7) of z-modeler has no .obj export, else i would give that a try and i'm not shure if the information get's lost in a other file format. but one thing i'm shure i can do with the normals what i want in z-modeler if i import a i.e. exported .3ds mesh then to blender everything except uv and unified (or split) vertices is lost, normals tuning like in z is not possible. further i think not all file formats support this.but i remember also that tomm once suggested that he could use a other model format, mainly this was because kenny (axeman3d) asked for it, because he couldn't export .obj from lightwave, without loosing uv.so this is still open, even if we (i) had to rework then all old models.another way i guess is like i suggested to map the mesh as one and where edges are unified to smooth uv will have to be one strip, usually this is not to manage, but i guess with a remapping and rebuild of the texture from a rendered body this should be possible (the texture will then be streched to the angle when "flattened" to uv). but i have to say rendering and remap from a render is not the thing i know much about.i havn't tried that never and would cost me a lot of investigations to find out how, i remember i liked to remap once a existing model using this feature of blender, but i didn't get to far with it.
s2odan
Private
Posts: 1212
Joined: Sun Mar 22, 2009 9:50 pm

RE: modeling for pioneer

Post by s2odan »

Ive been working on my panther model and trying to add different colours to the ship, so the colour of the ship is always differnt with every new ship.However my code is causing a crash, could you please have a look?
Code:
define_model('panther', { info = { scale = 1.0, bounding_radius = 30, --?? materials={'red', 'blue', 'green', 'dblue', 'lblue', 'yellow', 'text1', 'text2', 'dred', 'light', 'dark'}, tags = { 'ship' }, ship_defs = { { 'Panther', { 7*10^6,-87*10^6,4*10^6,-4*10^6,-4*10^6,4*10^6 }, 1*10^7, { { v(0,-0.5,0), v(0,0,-1) }, { v(0,0,0), v(0,0,1) }, }, { 930, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, 930, 460, 350000, 6 } } }, static = function(lod) set_material('red', .83,.2,.2,1,1.26,1.4,1.66,30)set_material('dred', .43,.1,.1,1,1.26,1.4,1.66,30)set_material('green', .1,.76,.76,1,1.26,1.4,1.66,30)set_material('yellow', .1,.73,.1,1,1.26,1.4,1.66,30)set_material('dblue', .1,.1,.45,1,1.26,1.4,1.66,30)set_material('blue', .1,.1,.63,1,1.26,1.4,1.66,30)set_material('lblue', .2,.2,.83,1,1.26,1.4,1.66,30)set_material('light', .9,.9,.9,1,1.26,1.4,1.66,30)set_material('dark', .1,.1,.1,1,1.26,1.4,1.66,30) end, dynamic = function(lod) selector2()if select2 < 10 thenuse_material('green')call_model('pant', v(0,0,0), v(1,0,0), v(0,1,0),1)elseif select2 < 20 thenuse_material('blue')call_model('pant', v(0,0,0), v(1,0,0), v(0,1,0),1)elseif select2 < 30 thenuse_material('light')call_model('pant', v(0,0,0), v(1,0,0), v(0,1,0),1)elseif select2 < 40 thenuse_material('red')call_model('pant', v(0,0,0), v(1,0,0), v(0,1,0),1)elseif select2 < 50 thenuse_material('dblue')call_model('pant', v(0,0,0), v(1,0,0), v(0,1,0),1)elseif select2 < 60 thenuse_material('dred')call_model('pant', v(0,0,0), v(1,0,0), v(0,1,0),1)elseif select2 < 70 thenuse_material('yellow')call_model('pant', v(0,0,0), v(1,0,0), v(0,1,0),1)elseif select2 < 80 thenuse_material('dark')call_model('pant', v(0,0,0), v(1,0,0), v(0,1,0),1)elseif select2 < 90 thenuse_material('lblue')call_model('pant', v(0,0,0), v(1,0,0), v(0,1,0),1)elseif select2 > 90 thenuse_material('light')call_model('pant', v(0,0,0), v(1,0,0), v(0,1,0),1)endendendendendendendendendendend })
EDIT//Nevermind I managed to get it working.[attachment=196:pioneer-msvc-9 2010-09-14 03-25-46-18.jpg]It works but the random colours are always very dark.
Potsmoke66
Private
Posts: 1815
Joined: Sun Nov 27, 2016 2:43 pm

RE: modeling for pioneer

Post by Potsmoke66 »

yes, my faultthe selector function is my egg,you can't call it from the final model, don't ask me why, it is that way.so you will have to call the "random" (reg no. based) selection from a sub-modeland call the resulting model in the final model.
Code:
define_model('panther_body', { info = { bounding_radius = 30 -- whatever size your ship has as max. diameter, for correct lod, preview win size and zoom max. materials={'pant'}, }. static = function(lod) use_material('pant') call_model('pant', v(0,0,0), v(1,0,0), v(0,1,0),1) -- or load_obj here end, dynamic = function(lod) selector2() if select2 < 10 then set_material('pant', .1,.76,.76,1,1.26,1.4,1.66,30) -- green else if select2 < 20 then set_material('pant', .1,.1,.63,1,1.26,1.4,1.66,30) -- blue else if select2 < 30 then set_material('pant', .9,.9,.9,1,1.26,1.4,1.66,30) -- light else if select2 < 40 then set_material('pant', .83,.2,.2,1,1.26,1.4,1.66,30) -- red else if select2 < 50 then set_material('pant', .1,.1,.45,1,1.26,1.4,1.66,30) -- dblue else if select2 < 60 then set_material('pant', .43,.1,.1,1,1.26,1.4,1.66,30) -- dred else if select2 < 70 then set_material('pant', .1,.73,.1,1,1.26,1.4,1.66,30) -- yellow else if select2 < 80 then set_material('pant', .1,.1,.1,1,1.26,1.4,1.66,30) -- dark else if select2 < 90 then set_material('pant', .2,.2,.83,1,1.26,1.4,1.66,30) -- lblue else if select2 > 89 then -- or you miss one (90) set_material('pant', .9,.9,.9,1,1.26,1.4,1.66,30) -- light end end end end end end end end end end end})define_model('panther', { info = { scale = 1.0, bounding_radius = 30, --?? materials = {}, tags = { 'ship' }, ship_defs = { { 'Panther', { 7*10^6,-87*10^6,4*10^6,-4*10^6,-4*10^6,4*10^6 }, 1*10^7, { { v(0,-0.5,0), v(0,0,-1) }, { v(0,0,0), v(0,0,1) }, }, { 930, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, 930, 460, 350000, 6 } } }, static = function(lod) call_model('panther_body', v(0,0,0), v(1,0,0), v(0,1,0),1) end})--[[but for a simple colorvariable i would prefer this,if you like to change the skin it's like the above method, only that you will have to call then skin and model dynamical.but as you can see i removed most of that from my models to keep as much resources free as possible.define_model('panther', { info = { scale = 1.0, bounding_radius = 30, materials = {'pant'}, tags = { 'ship' }, ship_defs = { { 'Panther', { 7*10^6,-87*10^6,4*10^6,-4*10^6,-4*10^6,4*10^6 }, 1*10^7, { { v(0,-0.5,0), v(0,0,-1) }, { v(0,0,0), v(0,0,1) }, }, { 930, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, 930, 460, 350000, 6 } } }, static = function(lod) use_material('pant') call_model('pant', v(0,0,0), v(1,0,0), v(0,1,0),1) end, dynamic = function(lod) set_material('pant', get_arg_material(0)) -- or get_arg_material(1) for a second color variable material end})
use the selector not to often. ;) i will see if i find something better in future, tomm once stated that it's on his mind to make certain argumentsavailable for models.something i would like is surface temperature of the planet where the city is build, so i could have different building sets for different worlds.
s2odan
Private
Posts: 1212
Joined: Sun Mar 22, 2009 9:50 pm

RE: modeling for pioneer

Post by s2odan »

Thanks, but it just doesn't seem to be working this way, always makes a crash in the game. Model viewer is fine but no game.No matter where I put the selector I cant get it to work right.I actually did manage to get some different colours using :
Code:
set_material('light', get_arg_material(0))use_material('light')call_model('pant', v(0,0,0), v(1,0,0), v(0,1,0),1)
But the colours are far too dark. Which is why I think the selector would be better. Use predefined colours that look good, instead of random ones.
Quote:
something i would like is surface temperature of the planet where the city is build, so i could have different building sets for different worlds.
Yes that would be good, maybe one for Atmosphere too?Edit/I've re-read this script again and again, and I cant find anything wrong with it yet the game crashes with it everytime I buy the ship.
Code:
define_model('pantengl', { info = { scale = 1.00, bounding_radius = 30, materials={'courier'}, }, static = function(lod) set_material('courier', .13,.13,.13,1,1.26,1.4,1.66,30) use_material('courier') texture('pantherleg.png') load_obj('panthereng.obj', Matrix.rotate(math.pi,v(0,0,1))) end }) define_model('pantengr', { info = { scale = 1.00, bounding_radius = 30, materials={'courier'}, }, static = function(lod) set_material('courier', .13,.13,.13,1,1.26,1.4,1.66,30) use_material('courier') texture('pantherleg.png') load_obj('panthereng.obj') end }) define_model('pant', { info = { scale = 1.70, bounding_radius = 30, -- ship size diameter materials={'pant', 'text1', 'text2'}, }, static = function(lod) texture('panther.png') load_obj('panther.obj') local vMainThruster1 = v(-7,5,15) local vMainThruster2 = v(7,5,15) thruster(vMainThruster1, v(0,0,1), 20, true) thruster(vMainThruster2, v(0,0,1), 20, true) end, dynamic = function(lod) local reg = get_arg_string(0)set_material('text1', .45,.45,.45,1,.1,.1,.1,10) set_material('text2', .55,.55,.1,1,.1,.1,.1,10)use_material('text1')text(reg, v(0, 5, 19.775), v(0,0.25,1), v(1,0,0), 0.5, {center=true})use_material('text2')text(reg, v(0, 4.6, -17.85), v(0,0,-1), v(-1,0,0), 0.3, {center=true})selector2() if select2 < 10 then set_material('pant', .1,.76,.76,1,1.26,1.4,1.66,30) -- green else if select2 < 20 then set_material('pant', .1,.1,.63,1,1.26,1.4,1.66,30) -- blue else if select2 < 30 then set_material('pant', .9,.9,.9,1,1.26,1.4,1.66,30) -- light else if select2 < 40 then set_material('pant', .83,.2,.2,1,1.26,1.4,1.66,30) -- red else if select2 < 50 then set_material('pant', .1,.1,.45,1,1.26,1.4,1.66,30) -- dblue else if select2 < 60 then set_material('pant', .43,.1,.1,1,1.26,1.4,1.66,30) -- dred else if select2 < 70 then set_material('pant', .1,.73,.1,1,1.26,1.4,1.66,30) -- yellow else if select2 < 80 then set_material('pant', .1,.1,.1,1,1.26,1.4,1.66,30) -- dark else if select2 < 90 then set_material('pant', .2,.2,.83,1,1.26,1.4,1.66,30) -- lblue else if select2 > 89 then -- or you miss one (90) set_material('pant', .9,.9,.9,1,1.26,1.4,1.66,30) -- light end end end end end end end end end end local v5 = v(-6,(1 + (0.5 - (0.5 * get_arg(0)))),(-6.35 + (6 * (1 - get_arg(0))))) --Moveable Thrusters, move with landing gear which is defined as get_arg(0) local v6 = v(6,(1 + (0.5 - (0.5 * get_arg(0)))),(-6.35 + (6 * (1 - get_arg(0))))) -- local v7 = v(-6,(1 + (0.5 - (0.5 * get_arg(0)))),(12.35 - (6 * (1 - get_arg(0))))) -- local v8 = v(6,(1 + (0.5 - (0.5 * get_arg(0)))),(12.35 - (6 * (1 - get_arg(0))))) thruster(v5, v(0,-get_arg(0),(-get_arg(0) + 0.8)), 9) thruster(v6, v(0,-get_arg(0),(-get_arg(0) + 0.8)), 9) thruster(v7, v(0,-get_arg(0),(get_arg(0) - 0.8)), 9) thruster(v8, v(0,-get_arg(0),(get_arg(0) - 0.8)), 9) local v1 = v(-6,(2.5 + get_arg(0)),-6) --TEMPORARY local v2 = v(6,(2.5 + get_arg(0)),-6) --TEMPORARY local v3 = v(-6,(2.5 + get_arg(0)),12) --TEMPORARY local v4 = v(6,(2.5 + get_arg(0)),12) zbias(1, v1, v(0,-1,0)) call_model('pantengl', v1, v(-1,0,0), v(0,(1 - (get_arg(0) * 1.2)),(get_arg(0)+0.1)), 1) call_model('pantengr', v2, v(-1,0,0), v(0,(1 - (get_arg(0) * 1.2)),(get_arg(0)+0.1)), 1) call_model('pantengl', v3, v(-1,0,0), v(0,(-1 + (get_arg(0) * 1.2)),(get_arg(0)+0.1)), 1) call_model('pantengr', v4, v(-1,0,0), v(0,(-1 + (get_arg(0) * 1.2)),(get_arg(0)+0.1)), 1) zbias(0) end }) define_model('panther', { info = { scale = 1.5, bounding_radius = 30, --?? materials={}, tags = { 'ship' }, ship_defs = { { 'Panther Clipper', { 28*10^6,-15*10^7,56*10^6,-12*10^6,-12*10^6,12*10^6 }, 1*10^7, { { v(0,-0.5,0), v(0,0,-1) }, { v(0,0,0), v(0,0,1) }, }, { 930, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, 930, 260, 350000, 6 } } },static = function(lod) call_model('pant', v(0,0,0), v(1,0,0), v(0,1,0),1) end })
Heres a copy of the working one for anyone to check out/bug-test if they like, but it has the very dark colours which I cannot rectify or now: EDIT// Dark colours fixed, should be better now.[attachment=200:Panther.7z]Some pics of different colours:[attachment=199:pioneer-msvc-9 2010-09-14 04-35-03-55.jpg][attachment=198:pioneer-msvc-9 2010-09-14 04-37-33-93.jpg]I'vs actually made a few different sets of textures for this, ranging from Old to New, so if I can get it to randomly pick between them then some ships would look new, some newish and some old. With rust and scratches.
tomm
Private
Posts: 129
Joined: Sat Mar 06, 2010 1:06 pm

RE: modeling for pioneer

Post by tomm »


s20dan wrote:
Thanks, but it just doesn't seem to be working this way, always makes a crash in the game. Model viewer is fine but no game.No matter where I put the selector I cant get it to work right.
Your model works for me. Have you tried the latest WIP build that i posted last night?http://pioneerspacesim.net/sites/default/files/pioneer-wip.rarIt also needs these two shader files put in data/shaders/http://pioneerspacesim.net/sites/default/files/bgstars.frag.glslhttp://pioneerspacesim.net/sites/default/files/bgstars.vert.glsl
Potsmoke66
Private
Posts: 1815
Joined: Sun Nov 27, 2016 2:43 pm

RE: modeling for pioneer

Post by Potsmoke66 »

that's a nice model, runs better then many other ;) i would do this...
Code:
define_model('pantengl', { info = { bounding_radius = 30, }, static = function(lod) texture('pantherleg.png') load_obj('panthereng.obj', Matrix.rotate(math.pi,v(0,0,1))) texture(nil) thruster(v(0,0,-7), v(0,0,-1), 9) end}) define_model('pantengr', { info = { bounding_radius = 30, }, static = function(lod) texture('pantherleg.png') load_obj('panthereng.obj') texture(nil) thruster(v(0,0,-7), v(0,0,-1), 9) end}) define_model('pant', { info = { scale = 2.55, bounding_radius = 70, materials={'cv0', 'text1', 'text2', 'dark'}, tags = { 'ship' }, ship_defs = { { 'Panther Clipper', { 28*10^6,-15*10^7,56*10^6,-12*10^6,-12*10^6,12*10^6 }, 1*10^7, { { v(0,-0.5,0), v(0,0,-1) }, { v(0,0,0), v(0,0,1) }, }, { 930, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, 930, 260, 350000, 6 } } }, static = function(lod) set_material('text1', .45,.45,.45,1,.1,.1,.1,10) set_material('text2', .55,.55,.1,1,.1,.1,.1,10) set_material('dark', .1,.1,.1,1,1.26,1.4,1.66,30) texture('panther.png') use_material('cv0') load_obj('panther.obj') --use_material('dark') --texture('/models/ships/new/panther/pantherdecals.png') texture(nil) local vMainThruster1 = v(-7,5,15) local vMainThruster2 = v(7,5,15) thruster(vMainThruster1, v(0,0,1), 20, true) thruster(vMainThruster2, v(0,0,1), 20, true) end, dynamic = function(lod) set_material('cv0', get_arg_material(0)) local reg = get_arg_string(0) use_material('text1') zbias(1, v(0, -1.127, 18.783), v(0,0.25,1)) text(reg, v(0, -1.127, 18.783), v(0,0.25,1), v(1,0,0), 1.2, {center=true}) zbias(0) use_material('text2') zbias(1, v(0, -1.527, -18.867), v(0,.2,-1)) text(reg, v(0, -1.527, -18.867), v(0,.2,-1), v(-1,0,0), 1.0, {center=true}) zbias(0) local v1 = v(-6,(-3.627 + get_arg(0)),-7.017) --TEMPORARY local v2 = v(6,(-3.627 + get_arg(0)),-7.017) --TEMPORARY local v3 = v(-6,(-3.627 + get_arg(0)),10.983) --TEMPORARY local v4 = v(6,(-3.627 + get_arg(0)),10.983) use_material('cv0') call_model('pantengl', v1, v(-1,0,0), v(0,(1 - (get_arg(0) * 1.2)),(get_arg(0)+0.1)), 1) use_material('cv0') -- i had to repeat this, when thruster is in submodel material changes after every use call_model('pantengr', v2, v(-1,0,0), v(0,(1 - (get_arg(0) * 1.2)),(get_arg(0)+0.1)), 1) use_material('cv0') call_model('pantengl', v3, v(-1,0,0), v(0,(-1 + (get_arg(0) * 1.2)),(get_arg(0)+0.1)), 1) use_material('cv0') call_model('pantengr', v4, v(-1,0,0), v(0,(-1 + (get_arg(0) * 1.2)),(get_arg(0)+0.1)), 1) end})
i also edited the pos. of the ship, because i guess it influences the ship in the game, but you decide where you want your axis.
panther_0.7z
just in case...testversion2_data.7z
Potsmoke66
Private
Posts: 1815
Joined: Sun Nov 27, 2016 2:43 pm

RE: modeling for pioneer

Post by Potsmoke66 »

[attachment=203:2010-09-14_135306.jpg][attachment=204:2010-09-14_135730.jpg][attachment=202:panther_1.7z]
Post Reply

Return to “Pioneer”