Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3 4   Go Down

Author Topic: Importing 3d models into IL2  (Read 16214 times)

0 Members and 1 Guest are viewing this topic.

SAS~Sani

  • Shredder
  • SAS Honourable Member
  • member
  • Offline Offline
  • Posts: 1152
Re: Importing 3d models into IL2
« Reply #12 on: November 04, 2010, 12:41:54 PM »

Two main parts are done,fuselage and tail...now landing gear and wheels so that it can stand
on it's own in game :)

I'll start with left wheel...make just shadow for it,center pivot to object (write down coordinates),
move to center of grid and export.Name exported mesh GearL1_Do.msh..



Do the same with other wheel and name it GearR1_Do.msh.



Next is this gear strut.


Left wheel is linked to this strut.Also,we need to link _ClipLGear hook to it.
Put the hook just below the wheel where ground should be.Basically,airplane stands on
these hooks._ClipRGear is added the same way for the other wheel on other gear strut.

Hit boxes are named xgearl and xgearr...you can add more,just add number to it,like
xgearl1,xgearl2 etc.In this case I have xgearl,xgearl1,xgearr and xgearr1.




Struts also need their pivots centered to object and they need to be moved to center
before export.Name them GearR2_Do.msh and GearL2_Do.msh.


There is no tail wheel here,but if you have one,procedure is the same as with main gear,
_ClipCGear is linked to same part as tail wheel.Here I have only wooden stick,so it's
realy simple.



About pivot point...this part should rotate while plane is steering on the ground.See screenshot
how I have set it up (steering rotation is around Z axis).Hit box for tail gear is
xgearc1.



After seting up pivot point,write down it's coordinates,move to center and export,
name it GearC1_D0.msh.

Next,first tests in game ;)
Logged

SAS~GJE52

  • SAS Team
  • member
  • Offline Offline
  • Posts: 4644
Re: Importing 3d models into IL2
« Reply #13 on: November 05, 2010, 03:29:52 AM »

Quote
Yes,but when tail gets shot off it flies away in a weird way,rotating around a point that is like 3m away from the actual object...and that's not looking good 

ALL parts in IL2 rotate around the center of max grid.

Thanks Sani, this is a really great series .... and I never realised the above.... is that the reason I always have bits of my aircraft sitting up in the air after a crash ..... ?

G
Logged
"The darkest places in Hell are reserved for those who maintain their neutrality in times of moral crisis"  The Divine Comedy. Dante Alighieri 1265-1321

SAS~Sani

  • Shredder
  • SAS Honourable Member
  • member
  • Offline Offline
  • Posts: 1152
Re: Importing 3d models into IL2
« Reply #14 on: November 05, 2010, 07:57:33 AM »

is that the reason I always have bits of my aircraft sitting up in the air after a crash ..... ?

Yes,depending how they fall on ground.
Logged

SAS~Sani

  • Shredder
  • SAS Honourable Member
  • member
  • Offline Offline
  • Posts: 1152
Re: Importing 3d models into IL2
« Reply #15 on: November 07, 2010, 09:20:38 AM »

Ok,now we will try to get few parts in game ;)...first,make a new slot (unarmed),
or get someone to make it for you.Then,open him file of that new slot plane and
hide all parts (just add "hidden" for each part).Copy your new meshes (with materials and textures) to plane folder.
Since CF has pivot coordinates in center of max grid, it wil llook like this in him file:

[CF_D0]
Mesh CF_D0
Parent _ROOT_
Attaching 1 0 0 0 1 0 0 0 1 0 0 0
CollisionObject xcf1
CollisionObject .xcockpit
CollisionObject .xxammo1


You must list here hit boxes that you have made in max.Hit boxes that are within another hitbox have
"." infront of their name.

Tail will also be simple:

[Tail1_D0]
Mesh Tail_D0
Parent CF_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 -2.643 0 0
CollisionObject xtail1
CollisionObject .xxspart
CollisionObject .xxcontrols8
CollisionObject .xxcontrols9
CollisionObject .xxtank1


Parent mesh of tail is CF.This means that tail mesh will regard CF's pivot point as the center of max grid.
Since CF's pivot is actually in grid center,there is no math involved ;),so you can
just put in tail's max coordinates.

Same goes for EngineCowling mesh:

[EngineCowling]
Mesh EngineCowling
Parent CF_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 1.06 0 0


Just write in max coordinates...separable means that this part will fall off/fly away
if plane hits the ground or explodes in mid air.

Gear struts:

[GearL2_D0]
Mesh GearL2_D0
Parent CF_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 0.205 0.456 -0.778
CollisionObject xgearl
CollisionObject xgearl1
[GearR2_D0]
Mesh GearR2_D0
Parent CF_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 0.205 -0.459 -0.778
CollisionObject xgearr
CollisionObject xgearr1



And now wheels...here things get a bit more complex.Parent of left wheel is GearL2.
So wheel will regard GearL2's pivot as center of max grid...but problem is that GearL2
is not in center (it's parent is CF).Coordinates of the wheel in max are:

x     0.561
y     0.75
z    -1.13


and coordinates of GearL2 in max are

x     0.205
y     0.456
z    -0.778


So,to get IL2 coordinates of the wheel that has a GearL2 as parent,we must do this:

X axis wheelIL2 = X axis wheelMax - X axis GearL2Max

X = 0.561 - 0.205
X = 0.356


basically, new parts max coordinates minus parent's max coordinates equals new parts
IL2 coordinates.You must do this for all tree axis (X,Y,Z).So in the end you will get
this for left wheel:

[GearL1_D0]
Mesh GearL1_D0
Parent GearL2_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1  0.356 0.294 -0.352


and this for right wheel:

[GearR1_D0]
Mesh GearR1_D0
Parent GearR2_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 0.354 -0.295 -0.355


You need to do the same thing for GearC (wooden stick on the tail).For GearC we will
get this:

[GearC1_D0]
Mesh GearC1_D0
Parent Tail1_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 -1.148 0 -0.076
CollisionObject xgearc1




When you do this for the first time it looks pretty complicated,especialy if there is a
big "parent tree",but later on it get's easy.

So after all this we have few parts in game :)





Now you can see if there are some smoothing issue or other problems that you don't
see in 3dmax.
Logged

Hawkman

  • member
  • Offline Offline
  • Posts: 199
Re: Importing 3d models into IL2
« Reply #16 on: November 08, 2010, 12:34:11 AM »

Sani

Many thanks for taking the time to write and post this - this is a great help :)

Hawkers :)
Logged

SAS~Sani

  • Shredder
  • SAS Honourable Member
  • member
  • Offline Offline
  • Posts: 1152
Re: Importing 3d models into IL2
« Reply #17 on: November 09, 2010, 04:48:48 AM »

Now I'm going to add that nice looking motor to it :).



Shadow is added...and this is
list of hit boxes that I've used:

xengine1
xxeng1case
xxeng1cyls1
xxeng1cyls2
xxeng1oil1
xxoil1


Only hooks that needs to be added here are _Engine1Oil and _Engine1Smoke.Obviously,
oil and smoke come out of these when engine is hit :).After connecting all that to main model,
export...it's parent is CF so coordinates are same as in max.

[Engine1_D0]
Mesh Engine1_D0
Parent CF_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 0.62 0 0.087
CollisionObject xengine1
CollisionObject .xxeng1case
CollisionObject .xxeng1cyls1
CollisionObject .xxeng1cyls2
CollisionObject .xxeng1oil1
CollisionObject .xxoil1



Engine is parent of propeller that we already have...max coordinates of propeller are
x=1.256,y=0,z=0...motors coordinates are x=0.62,x=0,z=0.087...so after a little math we
get this for propeller:

[Prop1_D0]
Mesh Prop1_D0
Parent Engine1_D0
Separable
Attaching 1 0 0 0 1 0 0 0 1 0.636 0 -0.087
CollisionObject xxeng1prop


So,this is how it looks in game




Here is a little twist...this propeller is rotating around wrong axis now.Default
rotation is around Y...right now propeller is orientated to rotate around X.I can fix this easily
by changing two digits of code....but for those that don't work with code,this is how you should
do it...open prop mesh in max.Move it to center and rotate it so that it faces in Y direction.



Export it like that....if you start the game you might notice a small issue




Start Kumpels matrix tool...you have rotated prop in max around Z axis by -90 degrees.
So,now you need to rotate it back into position with this tool....that means rotation of 90
degrees in positive direction:



Now we need to change prop's him data to this

[Prop1_D0]
Mesh Prop1_D0
Parent Engine1_D0
Separable
Attaching 0 -1 0   1 0 0   0 0 1 0.636 0 -0.087
CollisionObject xxeng1prop


And now it looks and rotates ok :)

Logged

Radar

  • member
  • Offline Offline
  • Posts: 376
    • il2war
Re: Importing 3d models into IL2
« Reply #18 on: November 23, 2010, 03:22:20 PM »

Ok,now we will try to get few parts in game ;)...first,make a new slot (unarmed),
or get someone to make it for you.Then,open him file of that new slot plane and
hide all parts (just add "hidden" for each part).Copy your new meshes (with materials and textures) to plane folder.
Since CF has pivot coordinates in center of max grid, it wil llook like this in him file:

i'm quite late over this topic
you know i'm posting when i can, but i'm trying to do it in sorted form ;)

i just dont want to grab a cow for her nuts  :P
i'm doing some tries and not sure if i'm doing right

i sliced/merged my model the il2 needed way
after done that i prepared and ported some meshes as you so nicely described (the same i did with bombs)
i created my class and entries for weapons/plane.properties 

i got the following
- the whole 3D0/model folder has to be used or the game will hang over missing references in hier.him
- after copy to the 3d0/model folder my exported meshes the starting hier.him needs to be edited (linking/swaping new meshes , leaving hidden references to the old ones), overwriting when necessary (there must be one only "link" for each mesh)
- the "hidden-notation" is to put the "Hidden" keyword in every hier.him entry before the "Attaching" one

but what should i pay attention to if by example
i'm linking "CowlingPlate" mesh to a "CF_D0" where there's no "CowlingPlate" link  in the original hier.him file ?

isn't there a smart way to write the hier file from scratch ? maybe starting from the easiest aircraft,
i know many crafts are obtained extending a base class getting control of each variant mesh and behaviour
can't a simplier craft mean fewer links to mess with un/hiding ?

catch ya
S!
Logged

SAS~Sani

  • Shredder
  • SAS Honourable Member
  • member
  • Offline Offline
  • Posts: 1152
Re: Importing 3d models into IL2
« Reply #19 on: November 23, 2010, 05:05:49 PM »

You can make a him file from scratch,but you need to know what parts exactly are needed...


In your case just make new entrie fro CowlingMesh,but pay attention that parent is always before the "child" in him file (game reads it from top to bottom).
Logged

Radar

  • member
  • Offline Offline
  • Posts: 376
    • il2war
Re: Importing 3d models into IL2
« Reply #20 on: November 24, 2010, 12:34:43 AM »

You can make a him file from scratch,but you need to know what parts exactly are needed...
is exactly what i meant: ramble sources in search of "needed" parts sucks
and keep an aircraft made of 3 meshes should be easier than merge starting from a bigger one

Quote
In your case just make new entrie fro CowlingMesh,but pay attention that parent is always before the "child" in him file (game reads it from top to bottom).
i'll surely do more tries as i can, thanks for help mate
S!
Logged

Radar

  • member
  • Offline Offline
  • Posts: 376
    • il2war
Re: Importing 3d models into IL2
« Reply #21 on: November 28, 2010, 06:02:39 AM »

update...
please guys don't scare :) :)

i did  as described i'm putting together slices of a Ba65 one of us has made a gift of
unfortunately the model still needs to be sliced and uvw mapped but this will surely halp my learning curve ( i hope )

i'd like to use a neutral/monochromatic skin the way i can better see the model
but something strange happens when i create a 8bit tga skin for this need:
every time i enter the select craft GUI window the screen becomes black and i have to kill the application :|
any idea ?


SOLVED: corrupted file skin1o.tga   
i strangely found this and some other tga dumped as 1x1px images :|
Logged

just champi

  • Modder
  • member
  • Offline Offline
  • Posts: 607
Re: Importing 3d models into IL2
« Reply #22 on: January 09, 2011, 07:03:28 AM »

Hi, sani, and everyone,  :)
I've been messing around a little with importing and I find out that maybe we don't really need to do the math to calculate the position of the parts that have a parent wich is not in the 0,0,0 position. It may be a lot simpler than that.
As simple as just changing the reference coordinates system to "Parent" for those child parts, who's parent's are not in the center of grid. The coordenates you'll see in the bottom coordenates roll-out, are the ones of the part referred to his parent's pivot point, not the world center, so the ones you need to put in the him file for that part (the same that you obtain doing the math)

By the way, I use the method of typing in the Max Listener: $NameOfMesh.transform to obtain the matrix coordenates to all the parts in a previous step and make a .txt file with the info to later using the data for attaching in the hier.him editing step.

I hope it helps a bit when doing importing because it tends to be already a very time consuming task. :(
Maybe in the future some smart mate can write an script to automate at least a part of the whole process...

PD: I pray every night to the Lord above, to see some more episodes of your wonderful tutorial series some day... or at least seeing you, featuring a good thrilling solo in MTV channel... :-[  Just joking, thanks for what you already posted :P
Logged

SAS~Sani

  • Shredder
  • SAS Honourable Member
  • member
  • Offline Offline
  • Posts: 1152
Re: Importing 3d models into IL2
« Reply #23 on: April 26, 2011, 01:21:31 PM »

Well,this might seem little,in quantity,what I've posted here.But I think it covers enough to teach you how to import whole plane ;)
Logged
Pages: 1 [2] 3 4   Go Up
 

Page created in 0.013 seconds with 27 queries.