The Art of War Modification Website
Would you like to react to this message? Create an account in a few clicks or log in to continue.

9/18/2011 - 3d Treads/wheels system

Go down

9/18/2011 - 3d Treads/wheels system Empty 9/18/2011 - 3d Treads/wheels system

Post  Marc15yo [Admin] Sun Sep 18, 2011 4:40 pm

Hey everyone, Today I'm going to talk about a new 'feature' that all our tracked vehicles will have. Now normally you are all used to seeing 2d treads. That is a plane (or flat surface) with wheels painted on them to give the appearance of wheels. After that the actual tracks were planes with a uv animation system to give the appearance of them moving. Well, in TAoW I changed all that. With CNC3 having support for more in depth tread animation I've decided to come up with a little trick of my own for full 3d treads.

The first part was of course to create the 3d treads wheels. The 3d treads are created exactly the same way as the 2d treads but the trick is to match/align the uv mapping for sides.
9/18/2011 - 3d Treads/wheels system 3d_treads

After that was the wheels. Now the wheels were a little tricky.
9/18/2011 - 3d Treads/wheels system 3d_wheels
CNC3 normally doesn't allow for 3d wheels to work with the native tread system (well, at least not mentioned anywhere in the documentation). So I went and created the wheels anyway. The tricky part about this is the naming sequence. Here is how I named the wheels:
"Wheel_01_L_S" - Stands for Wheel, #1, left, Stopped. This means it's the first wheel (1/9 for the abrams), on the left side, and having a 'stopped' animation, meaning inanimated.

After each wheel was created including for the right wheels The result is 18 wheels with this naming sequence. Once the stopped wheels are made I need to create the moving wheels. "Wheel_01_L_M" - Stands for Wheel, #1, left, Moving. These wheels are animated. They have a repetitive animtion of rolling forward. Once all 18 wheels are complete I move on to create the other wheels.

"Wheel_01_L_B" - Stands for Wheel, #1, left, Backing. These wheels are also animated but are rolling in reverse. That's it.


The second part was to modify the code. CNC3 allows model parameters to have a small 'scripts' section to it. Within that script section you can add custom scripts which aren't really custom since they are predefined by sage. But since I'm using the same technique used for the treads all I have to do is incorporate the same script but for the wheels.

ORIGINAL EXAMPLE CODE - animation state "idle" (default tread animation system):

ParseCondStateType="PARSE_DEFAULT">

AnimationName="UV_M1A2_01"
AnimationMode="LOOP" />

CurDrawableShowSubObject("TreadsStop")
CurDrawableHideSubObject("TreadsMove")
CurDrawableHideSubObject("TreadsLeft")
CurDrawableHideSubObject("TreadsRight")
CurDrawableHideSubObject("TreadsBack")



This is the animation state for "idle" or when the m1a2 is not doing anything. Obviously we don't want people to see the moving treads so the scripts hides any treads that are moving and show only the stopped treads (those without any uv animation).

All I had to do was add each wheel and incorporate it into the script.
Here is what this section looks now:

TAOW M1A2 EXAMPLE CODE - animation state "idle" (using 3d wheels+treads):

ParseCondStateType="PARSE_DEFAULT">

AnimationName="UV_M1A2_01"
AnimationMode="LOOP" />

CurDrawableShowSubObject("TreadsStop")
CurDrawableHideSubObject("TreadsMove")
CurDrawableHideSubObject("TreadsLeft")
CurDrawableHideSubObject("TreadsRight")
CurDrawableHideSubObject("TreadsBack")

CurDrawableShowSubObject("Wheel_01_L_S")
CurDrawableShowSubObject("Wheel_02_L_S")
CurDrawableShowSubObject("Wheel_03_L_S")
CurDrawableShowSubObject("Wheel_04_L_S")
CurDrawableShowSubObject("Wheel_05_L_S")
CurDrawableShowSubObject("Wheel_06_L_S")
CurDrawableShowSubObject("Wheel_07_L_S")
CurDrawableShowSubObject("Wheel_08_L_S")
CurDrawableShowSubObject("Wheel_09_L_S")

CurDrawableShowSubObject("Wheel_01_R_S")
CurDrawableShowSubObject("Wheel_02_R_S")
CurDrawableShowSubObject("Wheel_03_R_S")
CurDrawableShowSubObject("Wheel_04_R_S")
CurDrawableShowSubObject("Wheel_05_R_S")
CurDrawableShowSubObject("Wheel_06_R_S")
CurDrawableShowSubObject("Wheel_07_R_S")
CurDrawableShowSubObject("Wheel_08_R_S")
CurDrawableShowSubObject("Wheel_09_R_S")



CurDrawableHideSubObject("Wheel_01_L_M")
CurDrawableHideSubObject("Wheel_02_L_M")
CurDrawableHideSubObject("Wheel_03_L_M")
CurDrawableHideSubObject("Wheel_04_L_M")
CurDrawableHideSubObject("Wheel_05_L_M")
CurDrawableHideSubObject("Wheel_06_L_M")
CurDrawableHideSubObject("Wheel_07_L_M")
CurDrawableHideSubObject("Wheel_08_L_M")
CurDrawableHideSubObject("Wheel_09_L_M")

CurDrawableHideSubObject("Wheel_01_R_M")
CurDrawableHideSubObject("Wheel_02_R_M")
CurDrawableHideSubObject("Wheel_03_R_M")
CurDrawableHideSubObject("Wheel_04_R_M")
CurDrawableHideSubObject("Wheel_05_R_M")
CurDrawableHideSubObject("Wheel_06_R_M")
CurDrawableHideSubObject("Wheel_07_R_M")
CurDrawableHideSubObject("Wheel_08_R_M")
CurDrawableHideSubObject("Wheel_09_R_M")



CurDrawableHideSubObject("Wheel_01_L_B")
CurDrawableHideSubObject("Wheel_02_L_B")
CurDrawableHideSubObject("Wheel_03_L_B")
CurDrawableHideSubObject("Wheel_04_L_B")
CurDrawableHideSubObject("Wheel_05_L_B")
CurDrawableHideSubObject("Wheel_06_L_B")
CurDrawableHideSubObject("Wheel_07_L_B")
CurDrawableHideSubObject("Wheel_08_L_B")
CurDrawableHideSubObject("Wheel_09_L_B")

CurDrawableHideSubObject("Wheel_01_R_B")
CurDrawableHideSubObject("Wheel_02_R_B")
CurDrawableHideSubObject("Wheel_03_R_B")
CurDrawableHideSubObject("Wheel_04_R_B")
CurDrawableHideSubObject("Wheel_05_R_B")
CurDrawableHideSubObject("Wheel_06_R_B")
CurDrawableHideSubObject("Wheel_07_R_B")
CurDrawableHideSubObject("Wheel_08_R_B")
CurDrawableHideSubObject("Wheel_09_R_B")






Obviously all other animation states such as moving left, right, back etc must be coded in the same fashion. Of course the code is much longer since each wheel has to be accounted for (3 sets of 18 wheels) but it's 100% worth it.

The result is fully animated treads and wheels for the abrams in the CNC3 engine. + They use proper animations when turning left/right, moving forward and back. Cheers 9/18/2011 - 3d Treads/wheels system 2890
Marc15yo [Admin]
Marc15yo [Admin]
General of the Army [Administrator]
General of the Army [Administrator]

Posts : 3610
Join date : 2008-01-19
Age : 39
Location : United-States

https://taow.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum