• Welcome to PiBoSo Official Forum. Please login or sign up.
 
March 28, 2024, 02:57:30 PM

News:

World Racing Series beta14 available! :)


[HOW-TO] Animate the chain

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

Previous topic - Next topic

RiccoChicco

April 15, 2016, 05:27:42 PM Last 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

- 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


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!


h106frp

Brilliant, could you add a note for the correct method of UV mapping/texturing the chain?

Blackheart

My chain is "complex" so I just made a occlusion map and painted it (provisionally gold) with shader i think will be good.


RiccoChicco

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  8)

Blackheart

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

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

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

https://www.youtube.com/v/b7dDDVum7y0

HornetMaX

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  8)
I don't think it's possible to do this (have the 3d model "rotate" like in real life).

h106frp

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

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

Maybe i've a idea... after the sbk i try  :P

doubledragoncc

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

Well I think it is more useful a thread on the forum that pm between modders  :P

doubledragoncc

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.