August 13, 2022, 07:02:35 PM

## News:

GP Bikes beta20e available!

## [HOW-TO] Animate the chain

Started by RiccoChicco, April 15, 2016, 05:27:42 PM

#### RiccoChicco

##### April 15, 2016, 05:27:42 PMLast Edit: April 16, 2016, 10:33:27 AM by RiccoChicco
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

- 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

- Go to the chain section

`chain{name = chainpos{x = -63.175y = 0z = -10.107}engine{x = 0.0y = 0.0z = 0.00}texture = chainaxis = 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

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!

#### h106frp

##### April 15, 2016, 06:21:33 PM #1
Brilliant, could you add a note for the correct method of UV mapping/texturing the chain?

#### Blackheart

##### April 15, 2016, 06:37:02 PM #2
My chain is "complex" so I just made a occlusion map and painted it (provisionally gold) with shader i think will be good.

#### RiccoChicco

##### April 15, 2016, 07:12:59 PM #3
Quote from: h106frp on April 15, 2016, 06:21:33 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

#### Blackheart

##### April 15, 2016, 07:18:10 PM #4
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

P.S. I hate the chains!

#### Hawk

##### April 15, 2016, 08:10:29 PM #5
This is a great job Ricco! Thank you mate!

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

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

#### Blackheart

##### April 16, 2016, 07:41:58 AM #6
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?

#### HornetMaX

##### April 16, 2016, 09:12:20 AM #7
Quote from: RiccoChicco on April 15, 2016, 07:12:59 PM
@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
I don't think it's possible to do this (have the 3d model "rotate" like in real life).

#### h106frp

##### April 16, 2016, 09:15:43 AM #8
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

##### April 16, 2016, 09:23:49 AM #9
Quote from: h106frp 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

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

##### April 16, 2016, 10:31:53 AM #10 Last Edit: April 16, 2016, 10:55:39 AM by h106frp
Quote from: Blackheart on April 16, 2016, 09:23:49 AM
Quote from: h106frp 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

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

#### Blackheart

##### April 16, 2016, 11:18:06 AM #11
Maybe i've a idea... after the sbk i try

#### doubledragoncc

##### April 16, 2016, 11:20:26 AM #12
Manu has the chain done if I am correct, why not ask him BH?

DD
GPBOC Live Streams: https://www.youtube.com/c/IASystemsComputerControls; i7 12700K 5.1GHz Z690 ASUS Strix Z690-A Mobo 32GB 3600MHz DDR4 RAM ASUS Strix RTX3080 OC 10GB DDR6X ASUS Ryujin 360 AOI Cooler ROG Thor 1200w PSU in ROG Helios Tower Case.

#### Blackheart

##### April 16, 2016, 11:42:10 AM #13
Well I think it is more useful a thread on the forum that pm between modders

#### doubledragoncc

##### April 16, 2016, 11:50:10 AM #14
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; i7 12700K 5.1GHz Z690 ASUS Strix Z690-A Mobo 32GB 3600MHz DDR4 RAM ASUS Strix RTX3080 OC 10GB DDR6X ASUS Ryujin 360 AOI Cooler ROG Thor 1200w PSU in ROG Helios Tower Case.