Notifications
Clear all

To all SSC Station occupants

Thank you for the donations over the past year (2024), it is much appreciated. I am still trying to figure out how to migrate the forums to another community software (probably phpbb) but in the meantime I have updated the forum software to the latest version. SSC has been around a while so their is some very long time members here still using the site, thanks for making SSC home and sorry I haven't been as vocal as I should be in the forums I will try to improve my posting frequency.

Thank you again to all of the members that do take the time to donate a little, it helps keep this station functioning on the outer reaches of space.

-D1-

modeling for pioneer

Page 4 / 10
(@potsmoke66)
Noble Member

yes, my fault

the 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-model

and 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 arguments

available 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.

ReplyQuote
Topic starter Posted : September 13, 2010 17:50
(@s2odan)
Noble Member

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.

ReplyQuote
Posted : September 13, 2010 19:19
 tomm
(@tomm)
Estimable Member
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/defaul ... er-wip.rar

It also needs these two shader files put in data/shaders/

http://pioneerspacesim.net/sites/defaul ... .frag.glsl

http://pioneerspacesim.net/sites/defaul ... .vert.glsl

ReplyQuote
Posted : September 14, 2010 00:32
(@potsmoke66)
Noble Member

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.

[attachment=0]panther_0.7z[/attachment]

just in case...

testversion2_data.7z

ReplyQuote
Topic starter Posted : September 14, 2010 00:37
(@potsmoke66)
Noble Member

[attachment=203:2010-09-14_135306.jpg]

[attachment=204:2010-09-14_135730.jpg]

[attachment=202:panther_1.7z]

ReplyQuote
Topic starter Posted : September 14, 2010 02:46
(@s2odan)
Noble Member
Quote:
"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"

Duh! How did I not think of this? hehe, I had all that silly math to make the thusters move, when all I had to do was attach to the leg 😆 I suppose thats lack of sleep for you 😉

tomm wrote:

Your model works for me. Have you tried the latest WIP build that i posted last night?...

I didnt try that build no, but did you try the model with the different .lua script? Basically one script with random colours was working but I had a problem with dark colours, the other script with predefined colours was not working.

But its a moot point now anyway as I got the random colours to look better, all I had to do was change the colour of the texture from browny-green to grey-white.

potsmoke66 wrote:
that's a nice model, runs better then many other 😉

i would do this...

Thanks. And thanks too on getting the glow to work, I couldn't quite figure out how I was going to do that, your good 🙂

Is there anything else the ship should have before its finished?

ReplyQuote
Posted : September 14, 2010 07:27
 tomm
(@tomm)
Estimable Member

Ok this time for sure, the obj loading bug is gone. It was caused by not closing files that had been opened, so reaching a max open files limit... :/

It also fixes the very very slow frame rate with shaders enabled.

http://pioneerspacesim.net/sites/defaul ... er-wip.rar

ReplyQuote
Posted : September 14, 2010 11:01
(@potsmoke66)
Noble Member

if i leave out bgstars.frag.glsl everything works fine,

dunno why but this causes the bg stars to be like in lowest res and a framerate collapse,

but if i simply disable this file then it runs good.

ReplyQuote
Topic starter Posted : September 14, 2010 12:22
(@s2odan)
Noble Member

Tomm, the error reporting for the new modelviewer is really handy 🙂

Some pics of the reworked Boa:[attachment=205:pioneer-msvc-9 2010-09-15 19-49-47-80.jpg][attachment=207:pioneer-msvc-9 2010-09-15 19-48-11-88.jpg]

ReplyQuote
Posted : September 15, 2010 09:53
(@potsmoke66)
Noble Member

portside (left) red you're right,

not so long ago, i reworked all models because i thought it was wrong,

stupid me, i could had left them as they was.

ok, i'm born in the mountains, must be a reason 😉

but i have to say i also would miss which colour would have a pin for a turn left....

blue...?

or red?...

ReplyQuote
Topic starter Posted : September 15, 2010 10:33
(@s2odan)
Noble Member

🙂

I suppose it doesn't matter really which colours we use for each side. Boats only use red and green , sometimes white or yellow too for behind and front.

But the whole point of the running lights on boats is that its a visual aid, so that at night you can instantly tell the direction the boat is heading.

With Spaceships no-one would see them anyway because of the distances involved, it would all be done by radar and computers, so there would be absolutely no point in having running lights.

I suppose we should just add running lights of any colour depending on what suits the ship best?

The space-station could do with some running lights though don't you think? Green and red, so that you can always tell whether you are upside down or not in relation to the station.

ReplyQuote
Posted : September 15, 2010 11:52
(@potsmoke66)
Noble Member

good idea, but i guess it should be consistent for all,

in fact for the ships it doesn't matters much but if we keep a system behind then everybody will understand

why the stations got a green and a red light and possibly a 3rd white? to form a triangle, else you can't tell in space where is up, i mean you have no horizon, so you easely could be turned headover, whatever that is and left becomes right, right?

ahh.. you thought about red on back green on front, well ok, but what color marks the dock is free or occupied?

anyways if the lights strong (big) enough you won't need on the back, you can tell by lights or no lights, no matter green, red, orange or white.

no i have an idea, billboard lights can be placed in the space in front of the dock, like a leading fire, maybe slightly V shaped.

i thought about that allready, i've planned a spaceport and it will use the docking function of a station.

my idea was to use glowing rings that leads you to the dock, but i will see....

for a big object like a spacestation the position lights makes sense (even if some still have no door 😯 ).

ReplyQuote
Topic starter Posted : September 15, 2010 13:44
(@s2odan)
Noble Member

Yeah I agree thats a good idea, something like this yes? :

[attachment=209:Untitled-2.png]

And round the back there could be an orange light maybe?

potsmoke66 wrote:
.... but what color marks the dock is free or occupied?...

I think green or white, perhaps even blue for a free dock and red or orange for an occupied dock.

The only problem with green lights, is that you might not see them in a system with a massive red sun or is that the other way round? 😉

potsmoke66 wrote:
....even if some still have no door 😯 ).

Oxygen is for wimps!

ReplyQuote
Posted : September 15, 2010 14:18
(@s2odan)
Noble Member

Boa Freighter:

[attachment=210:pioneer-msvc-9 2010-09-16 04-15-33-12.jpg]

[attachment=211:pioneer-msvc-9 2010-09-16 04-12-17-73.jpg]

[attachment=212:pioneer-msvc-9 2010-09-16 04-08-09-16.jpg]

Still need to add proper landing gear, then it should be finished.

ReplyQuote
Posted : September 15, 2010 18:30
(@marcel)
Noble Member

You guys are doing great work! I'm so far behind you it's pathetic, but I'm hoping someone has the patience to give some help to an ignorant noob. I've been trying to texture the Ladybird Starfighter, just to learn how this lua stuff works. I can place a texture where I want to on the model, but the syntax of positioning the texture on the model confuses me. I've changed the numbers to see what they do, but I'm unable to discern a pattern that will allow me to place a texture properly. The wiki is rather vague on the subject.

Quote:
texture("blah.png", v(0,0,0), v(1,0,0), v(0,0,1))

will project the texture onto a flat plane, ie an x=0,z=0 plane, with texture u coordinates corresponding to model x coordinates and texture v coordinates corresponding to model z coordinates.

I've looked up uv mapping on Wikipedia, and it seems straightforward enough. My guess is that I need to project the texture in the 3D area of the quad that it supposed to lie upon, but would somebody be kind enough to define those 9 numbers and explain how to do that?

Thanks!

ReplyQuote
Posted : September 16, 2010 19:26
(@potsmoke66)
Noble Member

it starts to get well shaped...

the fins on the back could be "softer", imho.

uc anim, i guess most time i spend with them when working out a model.

check the eagles or the sidewinder how you can make a opening into a surface without breaking it up.

you can simply add a transparent shape to "cheat" a hole into a surface.

a transparent layer will "cut" through all shapes that are loadet or created afterwards, but leaves the previous loadet (created) shapes visible.

easiest, use no material for such a shape to cutout, if you have to, because you've allready applied a material previously,

then use a 0 alpha channel (0,0,0,0,0,0,0,0), if you see a black shape in modelviewer then use a temporary mask texture to make it invisible (a blank texture, uses only alpha channel, if that can't be made right with your paint prog. add one visible pixel in lower left corner i.e., you can remove the call for the texture and the texture when the model is finished, the game will show the transparency right.

at least this helps to make the opening for the uc somewhat easier, you can use flaps then to open/close the cage.

another idea is like the eagles uc, simply animate the "cutout" shape to open slowly, any shape is to imagine for it even a circle would look nice, if slided open it looks then like a iris blend.

you can make functions instead of sub_models, that allows to port some data from the model to them.

example (under construction):

Code:
function gelati(pos,rot,scale) -- pos=position, rot=rotation value, scale=scale x,y,z,
use_material('pine')
texture('pine_01.png')
load_obj('pine_01.obj', Matrix.translate(pos) * Matrix.rotate(rot*math.pi,v(0,1,0)) * Matrix.scale(scale))
end

function broccoli(pos,rot,scale) -- pos=position, rot=rotation value, scale=scale x,y,z,
use_material('oak')
texture('oak_01.png')
load_obj('oak_01.obj', Matrix.translate(pos) * Matrix.rotate(rot*math.pi,v(0,1,0)) * Matrix.scale(scale))
end

define_model('woods_0', {

info = {
bounding_radius = 30,
materials = {'pine', 'oak'},
},

static = function(lod)
set_material('oak', .6,.6,.6, .99, .4,.4,.3, 1)
set_material('pine', .5,.5,1, .99, .5,.4,.3, 1)

--[[
sizes:
normal = 1:1
large = 3:2
wide = 2:3
--]]

gelati(v(10,0,15),0,v(20,40,20))
gelati(v(-15,0,20),.3,v(17,25,17)) -- large
broccoli(v(20,0,5),0,v(15,10,15)) -- wide
gelati(v(15,0,-15),1.5,v(9,6,9))
broccoli(v(-20,0,-5),1.2,v(10,30,10))
gelati(v(10,0,-10),1,v(12,12,12)) -- normal
broccoli(v(-5,0,-20),1.2,v(9,9,9))
broccoli(v(5,0,-30),.7,v(9,9,9))
broccoli(v(0,0,0),.4,v(15,15,15))
gelati(v(20,0,-30),1,v(15,10,15))
broccoli(v(35,0,20),.3,v(10,30,10))
broccoli(v(-15,0,-35),1.5,v(20,13,20))
gelati(v(-30,0,-20),1.7,v(20,30,20))
broccoli(v(-45,0,-10),.2,v(15,10,15))
gelati(v(-15,0,5),.6,v(20,15,20))
broccoli(v(-35,0,10),.7,v(15,30,15))
gelati(v(-5,0,25),.5,v(20,10,20))
end
})

define_model('woods_1', {

info = {
bounding_radius = 30,
materials = {'pine', 'oak'},
},

static = function(lod)
set_material('oak', .6,.6,.6, .99, .4,.4,.3, 1)
set_material('pine', .5,.5,1, .99, .5,.4,.3, 1)

gelati(v(10,0,15),0,v(20,30,20)) -- large
gelati(v(-15,0,20),.3,v(17,25,17))
broccoli(v(20,0,5),0,v(15,10,15)) -- wide
gelati(v(15,0,-15),1.5,v(9,6,9))
broccoli(v(-20,0,-5),.6,v(10,30,10))
gelati(v(10,0,-10),1,v(12,12,12)) -- normal
broccoli(v(-5,0,-20),1.2,v(6,6,6))
broccoli(v(5,0,-20),.7,v(6,6,6))
end
})

or

Code:
function bld_base_1(lod)

local v0 = v(3,0,10)
local v1 = v(-3,0,10)
local v2 = v(7,0,3)
local v4 = v(7,0,-3)
local v6 = v(3,0,-7)
local v7 = v(-3,0,-7)
local v10 = v(3,-50,10)
local v11 = v(-3,-50,10)
local v12 = v(7,-50,3)
local v14 = v(7,-50,-3)
local v16 = v(3,-50,-7)
local v17 = v(-3,-50,-7)

local v20 = v(3,1,10)
local v21 = v(-3,1,10)
local v22 = v(7,1,3)
local v24 = v(7,1,-3)
local v26 = v(3,1,-7)
local v27 = v(-3,1,-7)

if lod > 1 then
use_material('concrete')
texture('conc.png', v(.5,.5,0),v(.05,0,0),v(0,0,1))
end
xref_quad(v0,v2,v4,v6)
quad(v0,v6,v7,v1)

if lod > 1 then
texture('conc.png', v(.5,.5,0),v(.05,0,0),v(0,.05,0))
end
quad(v0,v1,v11,v10)
quad(v6,v16,v17,v7)

if lod > 1 then
texture('conc.png', v(.5,.5,0),v(0,0,1),v(0,.05,0))
end
xref_quad(v0,v10,v12,v2)
xref_quad(v2,v12,v14,v4)
xref_quad(v4,v14,v16,v6)

if lod > 1 then
use_material('fce_glow')

texture('fence_glow.png', v(.5,.28,0),v(.1,0,0),v(0,1,0))
quad(v20,v0,v1,v21)
quad(v26,v27,v7,v6)

texture('fence_glow.png', v(.5,.28,0),v(0,0,.25),v(0,1,0))
xref_quad(v0,v20,v22,v2)
xref_quad(v2,v22,v24,v4)
xref_quad(v4,v24,v26,v6)

texture('fence_glow.png', v(.5,.28,0),v(.1,0,0),v(0,1,0))
quad(v20,v21,v1,v0)
quad(v26,v6,v7,v27)

texture('fence_glow.png', v(.5,.28,0),v(0,0,.25),v(0,1,0))
xref_quad(v0,v2,v22,v20)
xref_quad(v2,v4,v24,v22)
xref_quad(v4,v6,v26,v24)
end
end

function bld_base_2(lod)

local v0 = v(3,0,7)
local v1 = v(-3,0,7)
local v2 = v(7,0,3)
local v4 = v(7,0,-3)
local v6 = v(3,0,-7)
local v7 = v(-3,0,-7)
local v10 = v(3,-40,7)
local v11 = v(-3,-40,7)
local v12 = v(7,-40,3)
local v14 = v(7,-40,-3)
local v16 = v(3,-40,-7)
local v17 = v(-3,-40,-7)

local v20 = v(3,1,7)
local v21 = v(-3,1,7)
local v22 = v(7,1,3)
local v24 = v(7,1,-3)
local v26 = v(3,1,-7)
local v27 = v(-3,1,-7)

if lod > 1 then
use_material('concrete')
texture('conc.png', v(.5,.5,0),v(.05,0,0),v(0,0,1))
end
xref_quad(v0,v2,v4,v6)
quad(v0,v6,v7,v1)

if lod > 1 then
texture('conc.png', v(.5,.5,0),v(.05,0,0),v(0,.05,0))
end
quad(v0,v1,v11,v10)
quad(v6,v16,v17,v7)

if lod > 1 then
texture('conc.png', v(.5,.5,0),v(0,0,1),v(0,.05,0))
end
xref_quad(v0,v10,v12,v2)
xref_quad(v2,v12,v14,v4)
xref_quad(v4,v14,v16,v6)

if lod > 1 then
use_material('fce_glow')
texture('fence_glow.png', v(.5,.28,0),v(.1,0,0),v(0,1,0))
quad(v20,v0,v1,v21)
quad(v26,v27,v7,v6)

texture('fence_glow.png', v(.5,.28,0),v(0,0,.25),v(0,1,0))
xref_quad(v0,v20,v22,v2)
xref_quad(v2,v22,v24,v4)
xref_quad(v4,v24,v26,v6)

texture('fence_glow.png', v(.5,.28,0),v(.1,0,0),v(0,1,0))
quad(v20,v21,v1,v0)
quad(v26,v6,v7,v27)

texture('fence_glow.png', v(.5,.28,0),v(0,0,.25),v(0,1,0))
xref_quad(v0,v2,v22,v20)
xref_quad(v2,v4,v24,v22)
xref_quad(v4,v6,v26,v24)
end
end

function combo_sub(lod,type,r,g,b,a,sr,sg,sb,sl)

set_material('default',r,g,b,a,sr,sg,sb,sl)

set_material('fce_glow', 0,0,0,.9,0,0,0,0,1.5,2,.7)
set_material('concrete',.6,.6,.5,1,.3,.3,.3,5)
set_material('win_on', .2,.33,.35,1,1.5,1.8,2,100,1.6,1.8,1.8)
set_material('win_off', .2,.33,.35,1,1.5,1.8,2,100)
set_material('win', .2,.33,.35,.4,1.5,1.8,2,100)
set_material('cutout', .45,.55,.6,.9,.5,.5,.6,30)
set_material('trees', .7,.8,.6,.9,.5,.3,.3,1)
set_material('grass', .3,.6,.4,1,.5,.3,.3,1)

if lod > 1 then
use_material('default')
texture('alu.png')
end
load_obj('combo_0.obj')

if lod > 1 then
use_material('cutout')
texture('door.png',v(.5,.9,0),v(.5,0,0),v(0,-.5,0)) -- front
zbias(1,v(0,1.2,7),v(0,0,1))
circle(4,v(0,1.2,7),v(0,0,1),v(1,0,0),1)
zbias(0)

texture('door.png',v(.5,.88,0),v(.625,0,0),v(0,-.625,0)) -- front
zbias(1,v(0,5.8,3),v(0,0,1))
circle(4,v(0,5.8,3),v(0,0,1),v(1,0,0),.8)
zbias(0)

texture('alu.png')
use_material('win_on')
load_obj('combo_wins_on.obj')
use_material('win_off')
load_obj('combo_wins_off.obj')

texture('rgh.png',v(.5,.5,0),v(.2,0,0),v(0,0,1.2))
use_material('grass')
quad(v(3,5,7),v(3,5,3),v(-3,5,3),v(-3,5,7))

end

if type == 0 then
if lod > 1 then
texture('tree.png')
use_material('trees')
load_obj('bush_0.obj')
end
elseif type == 1 then
if lod > 1 then
texture('tree.png')
use_material('trees')
load_obj('bush_1.obj')

use_material('win')
texture('win.png',v(0,0,0),v(.2,0,0),v(0,0,1))
end
quad(v(3,5,7),v(3,7,3),v(-3,7,3),v(-3,5,7))

bld_base_1(lod)
end
end

define_model('combo_y', {
info = {
lod_pixels = {.1,10,50,0},
bounding_radius = 10,
materials = {'default', 'concrete', 'cutout', 'trees', 'grass', 'win', 'win_on', 'win_off', 'fce_glow'},
tags = {'city_building'},
},
static = function(lod)
combo_sub(lod,1,.6,.55,.4,1,1.26,1.4,1.66,30)
end
})

define_model('combo_g', {
info = {
lod_pixels = {.1,10,50,0},
bounding_radius = 10,
materials = {'default', 'concrete', 'cutout', 'trees', 'grass', 'win', 'win_on', 'win_off', 'fce_glow'},
tags = {'city_building'},
},
static = function(lod)
combo_sub(lod,1,.5,.6,.4,1,1.26,1.4,1.66,30)
end
})

that could be for shure a vector to, so you can "parent" animated vectors to your functions and link the parts proper.

it's a new idea* i had and my ships will have to be reworked all to this.

further this can help to write or load a model multiple times just for a variable like colors, position or rotation etc.

with a if request you could use it also to determine which texture the called function (part) should have (like i used for "type" in combo script).

i guess the ideal thing for the uc flaps, write just once, determine pos. and rotation (rotation of the part to fit to model not animation, but this will be possible to for shure, even better use uc animation only on the function(s) and just call he function in your model) and texture of the part by choice later.

*not really new, only new to me, i still have to find out a lot and the (better)use of functions is a "new" topic.

once i will rewrite the standard uc as function, let's say a bit a nicer one, with correct transparency for the cage and arguments to control the size, color and texture of them. i guess that coud be handy for simple model releases like my cobra mk1.

but first i have to fix the mess i produced in my install, actually it won't run because of i don't know, the models all work fine in modelviewer but somewhere i did a mistake and the game didn't start's proper, and outputs no error.

but i know by now it's somwhere in the station script i guess, at least that's the one which causes the error when ported to a new install.

ReplyQuote
Topic starter Posted : September 16, 2010 20:08
(@s2odan)
Noble Member
Marcel wrote:
You guys are doing great work! I'm so far behind you it's pathetic, but I'm hoping someone has the patience to give some help to an ignorant noob. I've been trying to texture the Ladybird Starfighter, just to learn how this lua stuff works. I can place a texture where I want to on the model, but the syntax of positioning the texture on the model confuses me. I've changed the numbers to see what they do, but I'm unable to discern a pattern that will allow me to place a texture properly. The wiki is rather vague on the subject.

I've looked up uv mapping on Wikipedia, and it seems straightforward enough. My guess is that I need to project the texture in the 3D area of the quad that it supposed to lie upon, but would somebody be kind enough to define those 9 numbers and explain how to do that?

Thanks!

I wish I could help man, but I don't really know about making models with the .lua scripting. All I know is making them in a proper CAD program and exporting, if you need help with that I would be glad to help.

Potsmoker is the man when it comes to making the models with .lua

I did actually make a start with trying to make a model with .lua and its very hard, so hard in fact that I really couldn't see the point, as anything you can do with lua you can do with a CAD program in about 10 minutes, whereas it will take days with .lua

I was trying to think of a suitable analogy and i think this fits nicely, modelling with lua is like cleaning every inch of you car with a small toothbrush 🙂

So my advice would be to grab a CAD prog like Blender or 3dsmax if your lucky to know someone with it 🙂 , and remake the ladybird starfighter in blender. This will teach you most of what you need to know. Be warned though, blender has the most backward interface ever designed by man.

(But I am a noob to, so take what I say with a pinch of salt hehe)

Another tip would be to read this thread (if you haven't) as there is some good information posted on the early pages. Stuff that would have saved me a lot of time if I could have just sat down and read it 🙂

potsmoke66 wrote:
it starts to get well shaped...

the fins on the back could be "softer", imho.

uc anim, i guess most time i spend with them when working out a model.

check the eagles or the sidewinder how you can make a opening into a surface without breaking it up.

you can simply add a transparent shape to "cheat" a hole into a surface.

a transparent layer will "cut" through all shapes that are loadet or created afterwards, but leaves the previous loadet (created) shapes visible...at least this helps to make the opening for the uc somewhat easier, you can use flaps then to open/close the cage.

another idea is like the eagles uc, simply animate the "cutout" shape to open slowly, any shape is to imagine for it even a circle would look nice, if slided open it looks then like a iris blend.

Thanks man. Yeah your right about the back fins, but Im stuck with them for the moment until I fix up the model again. Basically I 'Had' to add a subsurf to some of the parts and it left the opening between the body and the rear fins very large, so the fins are larger than normal now to hide that hole 😉 I will fix that later though.

With the UC I was going to detach some surfaces then save as a seperate model, then back on the original model, 'extrude' those same surfaces to make some holes. Then animate the separate model as the flaps.

But your circle idea could be quite good for the flaps, I might try that and see how it looks.

ReplyQuote
Posted : September 17, 2010 09:08
(@potsmoke66)
Noble Member

yes marcel, it gaves me a headake at first to,

i was asking tomm, how the heck...

he answered he sees no problem...

so i started to work that out myself...

best is to imagine that the texture will be projected on one of the three planes. x,y (y,x) represents a front view.

x,z represents a top view and y,z the side view to the object.

the first vector represents the position of the mapped UV plane, where on a regular quad with the center at v(0,0,0) v(.5,.5,0) will be the center of it, the last of the three indicators is not used since the texture has only two dimensions (u,v). v(.5,0,0) will be projected horzontally centered and vertical lowest, to imagine what it does. the size of the texture doesn't matters, but the position and size of the part you project on.

the next two vectors determine the scale or size of the texture, so it's possible to turn and mirror the texture in every direction. v(0,0,1) will project the texture in a size compliant to a quad 1x1, strangewisely you have to divide now this to strech the texture.

if a texture is projected from side or top it's a bit easier so this first.

v(.5,.5,0),v(.1,0,0),v(0,0,1) for a top projection x,z and v(.5,.5,0),v(0,0,1),v(0,.1,0) for a side projection z,y (i changed the pos. of the z value just to show that this is possible to turn a texture around, you can use also negative values to mirror a texture on a certain plane). do you smell something?

yes the z value stays 1, u can use z 1 if you like to have the texture streched on it's full size to the z vector.

the other vector has to be streched in the size of the part you project on, i havn't any mathematical expression for it, i do this mostly by experimenting and start usually with .5 or .1 and see later how much i have to divide further.

but there will be a way to calculate that, i found out that you can put the same transformation values on them as for the parts vectors and it works (i scaled the vectors of the part i.e. 1.8 up and divided the u,v values by the same number and it worked. same goes to pos. vector, move the vectors of the part +1.5 and add the same to the pos. vector and the tex is still in the same position).

front projection is a bit harder because both vectors (u+v) have to be divided, but for a regular projection allways in the same value, v(.5,.5,0), v(.1,0,0), v(0,.1,0) as example

i'm not shure but it seems that this values are allways 10 times smaller then the x/y values on the top or side projection

at start i had quiet some problems, but with some experience i'm now able to position texture exactly where i want.

nah, dan not weeks only days 😆

but i like scripted models and after all i can say some meshes simple like a cube or complex bodies are easier to create as .obj. but bezier shapes like it's used for the eagle or the arco have the advantage that their divs will be lod dependant.

same for cylinders, spheres and all shapes you can use divisions on.

and i guess marcel, want's to learn how it works, not only to create a model in no time 😉

further certain parts like the pistons of a uc are animated much easier this way, i.e. i strech simply the cylinder(s) i use for a piston from the start vector to the end vector, it looks almost the same as i would let it move as a "solid" part, but it will never be to short.

it is to imagine that a bezier shape can be morphed by math. expressions (think of a real cool morphing "flight of the navigator" ship 😉

of course this can be done in a good cad prog to, but to export a vector animation is not easy and .obj format supports no animations at all, so you would have to make a .obj for each step of the anim and load then each part at it's time on the animations flow.

a little extra from me the ladybird as .obj and .blend file, i used glxtractor (use the version tab to select, you will need both) to extract it from modelviewer and blender to position it to center then.

btw., .obj don't have to be textured using u,v in the script and the meshs (.obj) u,v can't be override by the script, just in case...

further ther are two ways to assign the texture, in the script using texture('soundso.png') or it's read from the .mat file if you like to use this, this would allow to have multiple textures to one .obj file, but material will stay the same. i'm not shure if the material setting in the .mat file is read and used in pioneer. original cobra3 that came with the game has used this i guess, but the material was inconsistent and changed sometimes depending on the view angle.

noch was,

wrapping of a texture isn't possible in general, but if you like to have a texture wrapped around a sphere or circle there is a trick that works foremost on parts in dimensions around 1/1/1 because you can't scale the texture then.

(i.e. a untransformed sphere or a cylinder(n*lod, v(0,0,0),v(0,1,0),v(0,0,1),"upto1")

use the texture('tex.png') command before you map any else using the position and scale vectors, the texture will now be "wrapped" around the body. works best on small parts and only if no texture is applied using scale and pos..

ReplyQuote
Topic starter Posted : September 17, 2010 21:28
(@marcel)
Noble Member

Thanks a lot, potsmoke66! I was feeling frustrated, thinking I'm just too stupid to do anything with this. I'm gratified to know that I was getting a vague idea of how this works, anyway. 😆 I'm having my morning coffee now, after a somewhat late night with beer, whiskey and friends. Things seem to make sense. I'll have a go at it after work. I know nobody cares about the Ladybird. She's a real turkey, but I'm trying to make her look nice. 🙂 If I can do this then I'll move on to the Interdictor!

ReplyQuote
Posted : September 18, 2010 04:55
(@potsmoke66)
Noble Member

or think of the wiggling tail of the turner class.

you don't see something like that very often in games...

but you can have it in pioneer 😎 and FFE of course, but hard to realise for FFED3D, possible, but not as "easy" as moving some vectors by expressions 😉

thanks to dan we can watch star-wars here, for free! 😆

and what you think how this ship would look like some big dolphin, instead of this bulky FFED3D version?

ReplyQuote
Topic starter Posted : September 18, 2010 05:49
(@s2odan)
Noble Member
potsmoke66 wrote:
or think of the wiggling tail of the turner class....and what you think how this ship would look like some big dolphin, instead of this bulky FFED3D version?

Yeah that would be better, I never really liked the FFED3D turner class, I actually preferred the original.

potsmoke66 wrote:
...it is to imagine that a bezier shape can be morphed by math. expressions (think of a real cool morphing "flight of the navigator" ship 😉 ...

Ok, i hadn't thought of that. It would be very cool. 😎

ReplyQuote
Posted : September 18, 2010 09:00
(@s2odan)
Noble Member

Here's a tester version of the Boa, anyone please give it a try and see if it works ok for you.

I added animated landing gear with flaps and recesses, smoother back tail-fins, running lights and a few other tweaks.

[attachment=215:Boa1909.7z]

[attachment=216:pioneer-msvc-9 2010-09-19 02-15-02-10.jpg]

[attachment=217:pioneer-msvc-9 2010-09-19 02-15-06-18.jpg]

ReplyQuote
Posted : September 18, 2010 16:19
(@marcel)
Noble Member

@ potsmoke66;

Quote:
do you smell something?

Yes! The sweet smell of success! I've got my test texture properly placed on the front quad of the Ladybird thanks to you. 😀

@ s20dan;

That Boa is looking good! I like the fact that you and potsmoke66 have different styles. It'll add some nice variety to the game. I've learned on the forum how to buy it cheap, so I'll download it and give it a test run!

ReplyQuote
Posted : September 18, 2010 18:52
(@s2odan)
Noble Member
Marcel wrote:
@ potsmoke66;

Yes! The sweet smell of success! I've got my test texture properly placed on the front quad of the Ladybird thanks to you. 😀

@ s20dan;

That Boa is looking good! I like the fact that you and potsmoke66 have different styles. It'll add some nice variety to the game. I've learned on the forum how to buy it cheap, so I'll download it and give it a test run!

Well done mate.

Cheers about the Boa, by the way, it should only cost a few hundred credits anyway as its just the test version so it can be swapped for the interdictor at a proffit.

ReplyQuote
Posted : September 19, 2010 06:29
(@marcel)
Noble Member

Ok, no hacking required. That was thoughtful. Well I didn't take her on a long trip, just out to Neptune and back. 😉 I bought an autopilot, but she was otherwise empty. She launched from Shanghai without incident, responding as sluggishly as I'd expect a ship of this size to behave. The modeling and texture appear a bit crude and alien, almost as if she was carved out of stone. The style reminds me of that big alien doomsday machine in the original Star Trek series. The one that they had to ram a starship down its throat to destroy. When I engaged the autopilot for Neptune, the Boa oscillated for quite a while before settling down to her heading. Arrived at Neptune, entered orbit saved the game and went to bed. This morning I headed back to Shanghai. I couldn't pick out Earth from that distance, so I set Mars as the target. Since I wasn't really going there I chose "arrive at the vicinity of Mars". The ship again oscillated before settling down. At 14.2 AU from Mars, the retros began to fire and the game locked up my entire OS. I had to press the restart button. This happened twice. The third time I selected a high orbit and things worked fine. I suspect it's a Pioneer bug. As I was maneuvering to land at Shanghai I experienced unusually slow frame rates and pauses. As I landed her I noticed that she's too long to fit inside the elevator! 😆 The game didn't care, though. I then bought an Eagle mk3 and launched it to test the frame rate issue. It was still there, although not as bad. This may be an issue with the latest Alpha 4 wip. I hate to think what kind of weapons a pirate's gonna put in this thing!

ReplyQuote
Posted : September 19, 2010 12:09
Page 4 / 10