Author Topic: [HOW-TO] Animate the chain  (Read 3265 times)

RiccoChicco

  • Sr. Member
  • ****
  • Posts: 423
  • Bultaco lover
    • View Profile
[HOW-TO] Animate the chain
« on: April 15, 2016, 05:27:42 PM »
All of the credits go to JC#21, which made this tutorial in french at motonline-france.com.

All images are available at full size by clicking it


Part I - Pivot positionning

- Select your chain object
- Go to "Hierarchy"
- Affect to pivot only
- Move the pivot at (0,0,0)
- Be sure to have the axis in the correct directions






Part II - Gearbox output

- Create an object (a sphere is perfect for that)
- Move it to the middle of the gearbox side of the chain using the left view
- The values we'll be using in the gfx.cfg appear at the bottom of 3ds Max



Part III - GFX file

- Open your gfx.cfg
- Go to the chain section

Code: [Select]
chain
{
name = chain
pos
{
x = -63.175
y = 0
z = -10.107
}
engine
{
x = 0.0
y = 0.0
z = 0.00
}
texture = chain
axis = v-
ratio = 0.016666
}

- The values in the "pos" section are the one which need to be changed. (values from 3ds Max)

Note : GP-Bikes and 3ds Max are not using the same axis. Check the previous picture to see how to choose the values.

Here's the corespondences between both :

GPbikes   3ds Max
   X     =    -Y
   Y     =     X
   Z     =    -Z


Part IV - Adjustments

With what we've done here, you should already be able to see a rotating chain ingame. The thing is that it's probably not well positionned. We'll see how to put it in the correct position.

Ingame screenshot :



In 3ds Max :



We can see that we need to rotate a bit the chain.

- Rotate de chain arround its axis on the rear wheel.
- Move the sphere we've created before at the correct position compared to the ingame screenshot.
- Update the values in the gfx.cfg.



Part V - Results

Now we've got a beauriful ingame chain, which rotate perfectly!



Part VI - Possible bugs

If the chain doesn't rotate in the correct direction, it should come from the unwrapping. Just edit the UVW unwrap, by mirroring it. It should works!

« Last Edit: April 16, 2016, 10:33:27 AM by RiccoChicco »

h106frp

  • Hero Member
  • *****
  • Posts: 1636
    • View Profile
Re: [HOW-TO] Animate the chain
« Reply #1 on: April 15, 2016, 06:21:33 PM »
Brilliant, could you add a note for the correct method of UV mapping/texturing the chain?

Blackheart

  • Guest
Re: [HOW-TO] Animate the chain
« Reply #2 on: April 15, 2016, 06:37:02 PM »
My chain is "complex" so I just made a occlusion map and painted it (provisionally gold) with shader i think will be good.


RiccoChicco

  • Sr. Member
  • ****
  • Posts: 423
  • Bultaco lover
    • View Profile
Re: [HOW-TO] Animate the chain
« Reply #3 on: April 15, 2016, 07:12:59 PM »
Brilliant, could you add a note for the correct method of UV mapping/texturing the chain?

Well, it depends on your model. I can't provide an exact method. Just unwrap your chain as you want and if it's in the wrong direction, mirror it  :)

@Blackheart

I received your files and I'll take a look tonight . But in your case, it's not the texture that needs to rotate, but the chain object. Not sure how to make it yet since I always used simple chains but maybe I can figure it out  8)

Blackheart

  • Guest
Re: [HOW-TO] Animate the chain
« Reply #4 on: April 15, 2016, 07:18:10 PM »
Ty Ricco, i can make also a simple chain, this was just a experiment. Now my chain link is far from the bike lol Surely I put a wrong value somewhere  ;D

P.S. I hate the chains!  :-X

Hawk

  • Hero Member
  • *****
  • Posts: 5814
  • MOD Team: CAWS / GP-Team: Horizon GP #7
    • View Profile
Re: [HOW-TO] Animate the chain
« Reply #5 on: April 15, 2016, 08:10:29 PM »
This is a great job Ricco! Thank you mate!  ;D 8)

@WALKEN/JANAU: Could you make this thread a STICKY please so that it doesn't get lost in the forum posts. Thank you!  ;) 8)

Hawk
PS: You can Delete my post if you like to help keep this thread clean when it's been Stickied.  ;)

Blackheart

  • Guest
Re: [HOW-TO] Animate the chain
« Reply #6 on: April 16, 2016, 07:41:58 AM »
Maybe I understand what is my problem with the chain; i make a new and very simple chain with a temp texture. The texture anim works, but the chain it is too close to the gear, for gpb chain and gear are 2 parts welded together!  :-\

Here a video, solutions?  ;D

<a href="https://www.youtube.com/v/b7dDDVum7y0" target="_blank" class="new_win">https://www.youtube.com/v/b7dDDVum7y0</a>

HornetMaX

  • Hero Member
  • *****
  • Posts: 5535
    • View Profile
Re: [HOW-TO] Animate the chain
« Reply #7 on: April 16, 2016, 09:12:20 AM »
@Blackheart

I received your files and I'll take a look tonight . But in your case, it's not the texture that needs to rotate, but the chain object. Not sure how to make it yet since I always used simple chains but maybe I can figure it out  8)
I don't think it's possible to do this (have the 3d model "rotate" like in real life).

h106frp

  • Hero Member
  • *****
  • Posts: 1636
    • View Profile
Re: [HOW-TO] Animate the chain
« Reply #8 on: April 16, 2016, 09:15:43 AM »
Looking at the config files chain should a separate named object in 'chassis' to let its texture rotate on its local axis. Notes axis V as in UVW

Blackheart

  • Guest
Re: [HOW-TO] Animate the chain
« Reply #9 on: April 16, 2016, 09:23:49 AM »
Looking at the config files chain should a separate named object in 'chassis' to let its texture rotate on its local axis. Notes axis V as in UVW

I thought for test insert it in the chassis scene, but also in the JC/Ricco tutorial refers to the rear wheel scene as my model :-\

h106frp

  • Hero Member
  • *****
  • Posts: 1636
    • View Profile
Re: [HOW-TO] Animate the chain
« Reply #10 on: April 16, 2016, 10:31:53 AM »
Looking at the config files chain should a separate named object in 'chassis' to let its texture rotate on its local axis. Notes axis V as in UVW

I thought for test insert it in the chassis scene, but also in the JC/Ricco tutorial refers to the rear wheel scene as my model :-\

In the std gfx.cfg it is referenced in the chassis section as an object and texture 'nchain' and you will need to see how your example models declare their structure in gfx.cfg. If we apply similar logic as we have for the rest of the models in gfx.cfg then it might be easier to create a new model edf just for the chain and declare that. I will give it a try later on, i have avoided tacking the chain up to now  ;)

Creating a separate .edf does not work  :( I will try it on the chassis, then swingarm (rsusp) - makes more sense as it will track the angular position correctly
« Last Edit: April 16, 2016, 10:55:39 AM by h106frp »

Blackheart

  • Guest
Re: [HOW-TO] Animate the chain
« Reply #11 on: April 16, 2016, 11:18:06 AM »
Maybe i've a idea... after the sbk i try  :P

doubledragoncc

  • Hero Member
  • *****
  • Posts: 4276
  • If it dont fit HIT it!!!!!!!!!
    • View Profile
    • GPBOC Live Streams
Re: [HOW-TO] Animate the chain
« Reply #12 on: April 16, 2016, 11:20:26 AM »
Manu has the chain done if I am correct, why not ask him BH?

DD
GPBOC Live Streams: https://www.youtube.com/c/IASystemsComputerControls

Teamspeak: Server IP: 82.43.148.211  user password "yougetin"

i5 7600 5.0GHz z270 ASUS Maximus Code Mobo 16GB 3866MHz DDR4 RAM ASUS Strix GTX1050Ti OC 4GB DDR5 Kraken X62 AIO Cooler

Blackheart

  • Guest
Re: [HOW-TO] Animate the chain
« Reply #13 on: April 16, 2016, 11:42:10 AM »
Well I think it is more useful a thread on the forum that pm between modders  :P

doubledragoncc

  • Hero Member
  • *****
  • Posts: 4276
  • If it dont fit HIT it!!!!!!!!!
    • View Profile
    • GPBOC Live Streams
Re: [HOW-TO] Animate the chain
« Reply #14 on: April 16, 2016, 11:50:10 AM »
Very true BH and kind of you to do so, but you could invite Manu to the party?

DD
GPBOC Live Streams: https://www.youtube.com/c/IASystemsComputerControls

Teamspeak: Server IP: 82.43.148.211  user password "yougetin"

i5 7600 5.0GHz z270 ASUS Maximus Code Mobo 16GB 3866MHz DDR4 RAM ASUS Strix GTX1050Ti OC 4GB DDR5 Kraken X62 AIO Cooler