IQM and Animation?

Discuss programming in the QuakeC language.
Post Reply
Rikku2000
Posts: 49
Joined: Wed Oct 20, 2010 6:33 pm
Location: Germany
Contact:

IQM and Animation?

Post by Rikku2000 »

Hey guys i had a question i am useing IQM model for my Game so i know it use Framegroups but how to use it on Quake?

Mean a quake model dont have bones just Frames but IQM have Bones so how i can call the Frames as Animation? is there
an simple Tutorial how to use? coz i want replace the Weapons.

Thank you.
I am sorry for my English...
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: IQM and Animation?

Post by Spike »

.frame selects the displayed framegroup.
in csqc, .frame1time selects the time into the animation, while in ssqc it autoanimates based upon when the client first sees it.
(in csqc, you can interpolate with .lerpfrac which controls how much of .frame2(+frame2time), and this can give you 4-way interpolation. in ssqc the client will automatically update the internal equivelents of lerpfrac/frame2 for you).

if you need more advanced animation blending and stuff, you need to use FTE_CSQC_SKELETONOBJECTS from csqc.
this will allow you to use skel_build to copy weighted parts of animations into a skeletal object and then using that skeletal object's pose instead of the pose normally implied by just the .frame field (and friends).
if you're confident with your matricies, you can use the skel_mul etc builtins to provide programatic animations by directly editing the skeletal object's pose.
this advanced stuff is NOT mandatory and can be quite mathsy, you can still animate iqms without it.
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: IQM and Animation?

Post by Nahuel »

SIMPLE WAY:

you just can use an iqm model like a regular mdl file, you only need to use each frame as a framegroup

For example.

IF You have an iqm called "rocketlauncher.iqm" with 20 frames you need to create a framegroup file with notepad like this:

Code: Select all


1 1 1 0  
2 1 1 0  
3 1 1 0  
4 1 1 0  
5 1 1 0  
6 1 1 0  
7 1 1 0  
8 1 1 0  
9 1 1 0  
10 1 1 0  
11 1 1 0  
12 1 1 0  
13 1 1 0  
14 1 1 0  
15 1 1 0  
16 1 1 0  
17 1 1 0  
18 1 1 0  
19 1 1 0  
20 1 1 0  



So you will save it with the name

"rocketlauncher.iqm.framegroups" and place it in the same directory where "rocketlauncher.iqm" is located.


About the framegroups file:
Quoting this post in quakeone
The first number represents the start frame of the animation (.framegroups files always start at frame 0, some modeling software starts at 1, so you might have to subtract 1 for the start frame).

The second number represents how many frames is in that specific frame group.

The third number is the frame rate at which the sequence plays. This is independent from what the monsters "think" rate is, which I have set at 10 frames-per-second.

The fourth number is whether the frame sequence loops. 1 for true, 0 for false. The only frame groups that should loop are the standing, walking and running animations.


I know is very tedious to make framegroups for models with really many frames, you can use this sample generated for the darkplaces model compiler. It will work in every iqm model (if you wan you only need to cut the specific number of frames in the framegroups file, but it will work aniway)
https://www.dropbox.com/s/9clszuks7l5q9 ... roups?dl=0
hi, I am nahuel, I love quake and qc.
Rikku2000
Posts: 49
Joined: Wed Oct 20, 2010 6:33 pm
Location: Germany
Contact:

Re: IQM and Animation?

Post by Rikku2000 »

Thank you guys thats realy helpfull :) hope it will work on my game haha :)

Ah okey i got it, so:
[Start Frame][Frames in Loop][FPS][Loop]
1 5 10 0

is that right?
So Frame 1 have 5 Frames: "1-5" and will Play with 10 FPS and dont Loop, right?
I am sorry for my English...
jjsullivan5196
Posts: 21
Joined: Sun Apr 21, 2013 10:50 pm

Re: IQM and Animation?

Post by jjsullivan5196 »

Rikku2000 wrote:Thank you guys thats realy helpfull :) hope it will work on my game haha :)

Ah okey i got it, so:
[Start Frame][Frames in Loop][FPS][Loop]
1 5 10 0

is that right?
So Frame 1 have 5 Frames: "1-5" and will Play with 10 FPS and dont Loop, right?
framegroups uses a 0 index so frame 1 is really frame 0. Always start your framegroups table from zero.
Post Reply