PDA

View Full Version : Story telling, animations



Petr Schreiber
06-03-2007, 20:48
Hi,

as kryton9 requested some more info on animations for the game, I have few ideas:

Mike has a set of great profi tools ( Poser, ... ), if he has some time, they would be great for creating some story animations.

In game animations would be also good, for simplier stuff like just ship entering hangar or something like that.
For this kind of stuff TBGL animation functions could be used.

I have prepaired very very simple demoscript on this topic.
It is just silly UFO with animable cockpit part - please see in attached source.

I will show you what's behind it...

I have created the model of UFO in thinEdge. The main body part is stored in "UFO_Body" layer, cockpit glass in "UFO_Glass".

To define bone for the glass part, you just have to load the model :) and do this:




tbgl_m15DefBoneLayer %MODEL_UFO, %BONE_FOR_GLASSPART, "UFO_Glass", 0.25, 0.38, 0




I have used some equates to make parameters clear.
So first parameter is model number, second is ID of the bone ( 1 to 32, may be improved in future releases of TBGL ).

Third parameter is string, containing layer name you want to became bone-controlled.

Last 3 numbers are "anchor", point around which the bone will rotate. I just decided for mentioned point, as I now this part could have joint at this coordinates.

To animate the model, you must do following steps:


tbgl_m15resetBones %MODEL_UFO

tbgl_m15RotBoneZ %MODEL_UFO, %BONE_FOR_GLASSPART, -45 + sin(gettickcount/1000)*45

tbgl_m15ApplyBones %MODEL_UFO

tbgl_m15DrawModel %MODEL_UFO

First, you need to reset bone angles in model you want to animate.
Then you set the rotation, in this case around Z axis. After that you just apply the bones and render the model.


Hope you were able to follow me, if not please ask :),
Petr



Edit by MikeHart: The first code entry wasn't visible :)

Michael Hartlef
06-03-2007, 21:50
I will see how I can get the layer part out of Blender. Thanks for the info.

kryton9
06-03-2007, 22:05
Thanks for the example and explanation Petr, I will play with it and see if how we can use this more!!


Mike, you are spoiling me rotten, now adding layer support. I like it when life is made easy with great tools!!!
Thanks.

Michael Hartlef
06-03-2007, 22:07
It is important that the artistic freedom is not blocked by complicated workflows. ;)

kryton9
07-03-2007, 08:07
Nice phrase there Mike, thanks.

Petr, I think it would be neat to have a similar command to the addbone command.
But one where I could just add another m15 model.

I was trying to assemble a multi m15 project tonight but no luck. I was going to make a cool demo with Mike's new tbdi commands.

A very simple robot arm:

Base this would just rotate around the y axis
A1 the first arm part from base to elbow. This would rotate around z axis
A2 this with would be forarm and thumb sort of. Would rotate around z too.
A3 this was like the claw bottom it too would rotate around z axis.

So something like tbgl_AddModelBone ParentModelID, ModelToAddID, ToBoneNumber, posX, posY, posZ

Also it would be nice to have a translate command in addition to rotate command for boned models.
Also a scale command.

tbgl_boneTranslate ModelToTranslate, BoneNumberItIsOn, posX,posY,posZ (parentModelID could also be part of it to help keep it clear)
tbgl_boneScale ModelToScale, BoneNumberItIsOn, scaleX,scaleY,scaleZ (parentModelID could also be part of it to help keep it clear)

I will attach the very simple models I made. They might need to be scaled to each other, I sort of went from memory how the previous model was and hope they were close.

Is there a way to load each m15 file into a separate layer in thinEdge?

catventure
07-03-2007, 14:11
Hi Kryton,Mike,Petr,

I came across this and thought it may be of interest to look at:

http://www.anim8or.com/main/index.html

catventure

kryton9
07-03-2007, 14:32
Thanks CatVenture. It is a very nice program indeed.

Michael Hartlef
07-03-2007, 14:34
Hi Kryton,Mike,Petr,

I came across this and thought it may be of interest to look at:

http://www.anim8or.com/main/index.html

catventure


Thanks, I head about it.

Petr Schreiber
07-03-2007, 21:28
Hi all,

I feel very bad for it, but I will have less access and possibilities to reply in next two days on this forum. Nothing terrible happens with me, I'm just terribly out of time :(

catventure, anim8tor looks cool. I think I have tried it in the past, but now I will check it again and more carefully.

kryton, thanks for the models. To achieve your goal, you can now use tbgl_Push/PopMatrix magic. As soon as I will have more time, I will post here sample - it is quite easy, you will see :)

I'm considering your suggestions for TBGL, just need to think carefully about it.

I am really sorry my "TBGL support" is terribly lacking in this days, hope it will get better soon ( I know it !)


Thanks,
Petr

kryton9
08-03-2007, 01:36
Petr, no worries, just posting ideas or questions as they come. School is first as is family. Never feel bad about that time shortage for those things. Get to it when you can. Thanks and good luck with school!

Petr Schreiber
08-03-2007, 21:13
Thanks kryton,

I am still quite busy, so I tried to implement your robot just the "quick way".
Please see the source - it clearly shows the hierarchy.

The push/pop matrix commands are little bit unnecessary for latest member (A3) in this particular sample, but I used them to make the parts looking better separated.


Bye,
Petr

kryton9
08-03-2007, 22:47
Petr, that is the example I needed. Thanks so much!!

Now to add some joystick commands and have a controllable robot arm. Hope to be back soon with that today. Thanks!!