[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - boning my models

boning my models

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

boning my models

Postby behind_you » Wed May 11, 2011 9:56 am

im in the process of remaking my md2 into bone models since md2 jiggle uncontrollably for some reason. md3 causes me problems because of it's limits, so i checked out ways to implement boned models

this is a topic that really yearns a decent tutorial. dpextensions.qc doesn't explain well, it just leaves me confused.

ok, from what i can comprehend from dpextensions.qc, i think u have to 'recreate' your model's skeletal arrangement in qc code:

ie:

neck bone
||
||
\/
chest bone ==> arms
||
||
\/
legs

is this correct? then i presume you have to make a framegroups file for every model you want to animate.

ie:

1 10 10 0//idle (firstframe,numberofframes,framepersec,loop)

how would you make the model do this animation at any given point? do u have to use framegroup files? is there any other way of animating skeletal models besides the motion1 = [$motion1, motion2]{}: technique?

i can't get any bones to move, let alone blend them (which requires csqc, if i'm not mistaken). so how do you cause your player model to show up with csqc?

any help will be appreciated!
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby Spike » Wed May 11, 2011 11:37 am

to animate something in csqc, you have a few different fields.

.frame
.frame2
.lerpfrac
.frame1time
.frame2time

What these fields provide you is 4-way interpolation.

if .frame refers to a framegroup, then that framegroup will be animated using the frame1time field, specifically this field says the time offset of the animation. You can change the speed of the animation by adding different amounts relative to the current frame time. Adding distance moved may be a good value for walking animations, for instance.

When your model is meant to start shooting, its time to blend. You can blend by setting the .frame to the new frame, the .frame2 field to the old frame, and the .lerpfrac field to the amount of frame2 to use (0 to 1). Over time, reduce the influence of frame2 by reducing lerpfrac to 0. Make sure you keep the animation times running.

for ssqc code, the frame1time/frame2time is defined to be (curtime - frameXstarttime), for the most part. csqc has more control, but it generally has to update the field each frame.


if your model does not use framegroups, then you only have the 3 fields, frame, frame2, lerpfrac, that need to be considered. Creating viable animations is more awkward here, however.

The description above applies whether the model is skeletal or not.

There are additional extensions which provide direct skeletal control.

One of them is FTE's basebone stuff, which adds 6 additional fields:
.basebone
.baseframe
.baseframe2
.baselerpfrac
.baseframe2time
.baseframe1time
these fields can be used to animate a models legs or so sepearately from the torso. Specificially, they work just as the fields descibed earlier, except apply to bones 0 up to the bone specified by basebone, while the standard fields described earlier affect bones between basebone and the max. So you can split the model into two separate logical animations. DP does not support them however.

The other is the skeletal objects extension, which is fairly complicated.
There is a builtin which creates a new skeletal object, as well as a builtin that destroys one.
You can attach an individual skeletal object to one or multiple entities. All entities using that skeletal object will have their animations overridden by the object's bonestate. You can copy the bonestate from an entity into a skeletal object by using skel_build. This builtin takes a bone range, which permits you to copy only a subset of the bones. So you can set your animation for the legs, copy the legs, set the animation for the torso, then copy that part over too. There is again a 'frac' value to copy in, which means that you can apply various percentages if you wish to blend in multiple animations.
You can call skel_build using any source modelindex you want. This permits you to copy animations from other models if you're too lazy to create animations for every model, for instance, or if you have each framegroup stored seperately from the mesh itself (like doom3/md5 does). They need to be compatible or it makes no sense, of course. Its plausable that if you have a specific bone heirachy used for every single model player model, then you can have meshes that can be positioned over arbitary attachment points like hats or so, even if each player model has different actual animations (hats with rims that bob, rather than statically positioned hats that don't react to the animations of the player other than moving just their origin).
Additionally, there are a couple of extra builtins which allow you to specify the precise angles/offset of specific bones. This is useful for torsos or necks if you want to angle it separately from the rest of the model. Using some maths, you can get eyeballs on stalks to twist in weird ways to always watch the camera, or directly control segments of a robe to give a somewhat realisitic swinging animation.


Basically, you need your bone ordering to be somewhat logical, or the bone ranges that the builtins accept will not make sense. The builtins do not understand groups of bones in any way other than as a range of bones. The group of bones that are the lower body are logically everything up to the hip bone. All leg bones must be numerically lower than this terminating hip bone. As an example. Then you can use skel_build on 0-to-hip, and hip-to-max. The same would apply if you wanted to control only one arm, in which case you would want every bone from the shoulder to the finger tips to be in a single consecutive list so that you can control them all in one go.
Again, framegroups are also optional, but using them properly and where it makes sense is likely to result in simpler code.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby behind_you » Thu May 12, 2011 6:52 am

User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby Spike » Thu May 12, 2011 2:10 pm

.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby behind_you » Sat May 14, 2011 7:48 am

User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby Spike » Sat May 14, 2011 12:45 pm

.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby behind_you » Tue May 31, 2011 6:50 am

User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby toneddu2000 » Tue May 31, 2011 10:28 am

toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Postby behind_you » Wed Jun 01, 2011 6:50 am

User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby toneddu2000 » Wed Jun 01, 2011 9:42 pm

toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Postby behind_you » Wed Jun 08, 2011 6:56 am

User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby toneddu2000 » Wed Jun 08, 2011 6:37 pm

toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Postby behind_you » Mon Jun 13, 2011 6:34 am

User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby behind_you » Tue Jun 14, 2011 7:50 am

Alright, I think I figured it out. for the self.frame i realized that in order to do a certain animation specified by the framegroups file, you must do this:

"FRAMEGROUPS file has this:"

//first frame num of frames framerate loopflag
1 10 10 0 //idle animation AKA 0
11 30 10 0//running animation AKA 1

so to do the run animation, set your self.frame = 1 and to do the idle animation, set it to 0. i was thinking that to run you have to set your frame to 11 since that's the frame when the running animation starts.

so I finally got it working! oh and thanks toneddu2000 for pointing out that the ref animation macro was not needed. now I will try to send my entity through to csqc. i will post any progress i make
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby toneddu2000 » Wed Jun 15, 2011 7:28 am

toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 3 guests