Author Topic: new animation enhanceing feature  (Read 6005 times)

0 Members and 1 Guest are viewing this topic.

Offline Vasudan Admiral

  • Member
  • 211
    • Twisted Infinities
Re: new animation enhanceing feature
Not sure if this is how that particular recoil is done, but there was a new animation type added not too long ago that triggers an animation when the turret it is a part of fires.

To fake the translation, the recoiling part would need a centre with a big offset from the actual geometry, so when it rotates a very small distance, it appears to be sliding. However, the tiny rotations also mean it's hard to have fine control over - which is what I'm guessing causes the jerk?

http://www.hard-light.net/wiki/index.php/Animation_Code

Specifically:
Code: [Select]
* turret firing
    -  Animation code is started when selected turret is firing
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 
 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: new animation enhanceing feature
ok...

"2) box checking was based on View position rather than being based on Eye position and the offset from parent model like it should have been"

that was intentional, View_position is the camera rotated into the model's frame of reference, you just see if it's coords are bigger than the box and it works, there is less math involved in evaluating a box this way, and if you base it off of the eye position then you need to sum up all the offsets in lower children, otherwise it isn't right. a lot of the code involved was originally coded to minimize the cost of a render box evaluation (and the failure there of).

----------

no I don't have access to the SoL internal

----------

I have in a separate code base some work done on getting translation working for triggered animations, the biggest problem is related to bounding boxes and when an object moves far enough that it is no longer in it's parent's bounding box it gets culled from collision detection when it shouldn't. the obvious solution to this is the check all objects that have a translation even if they fail up stream bounding box checks, but given the nature of the object hierarchy tree this is a bit more complicated than it would first seem, I'll probably need to add a subobject flag that indicates that a child has a translation applied.

there is also exactly 3.7 ****loads of places were the code assumes that an object or subsystem's position never changes, and so it will for example precalculate a subsystem's position relative to the ship.
----------

"Is the "$look_at:subobject number" in the sumbmodel properties field all that's needed to get this working ?"

yes, as mentioned it's a non-subsystem animation type, as it does not need to keep track of any information between frames (like triggered animations do) they don't need to be part of a subsystem

-----------

another way you could fake translations in the mean time would be with use of several invisible subobjects that would form a trapezoid, you just squeeze the angles and the top would shrink.
« Last Edit: November 23, 2006, 12:11:26 pm by Bobboau »
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: new animation enhanceing feature
ok...

"2) box checking was based on View position rather than being based on Eye position and the offset from parent model like it should have been"

that was intentional, View_position is the camera rotated into the model's frame of reference, you just see if it's coords are bigger than the box and it works, there is less math involved in evaluating a box this way, and if you base it off of the eye position then you need to sum up all the offsets in lower children, otherwise it isn't right. a lot of the code involved was originally coded to minimize the cost of a render box evaluation (and the failure there of).
It is still based on View_position, I didn't mean to write "Eye" there.  It does still need to facter in the offset though to deal with how the detail box values are set, at least in an intuitive manner.  Otherwise you will have to factor in the offset into the detail box boundries before hand, which means that it has to be done by the model maker.  I'm not sure how it was used before, but after tracing through the original code I couldn't see any way how it would have worked properly before.  Only if the model maker did an excessive amount of work which was totally unnecessary, perhaps, but that it was apparently too screwed up for anyone to actually get working.

Having it based on anything didn't really matter though, since the min/max Y and Z coords for the detail box were never used from the model.  That it worked at all in the first place is something of a miracle. :)

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: new animation enhanceing feature
it was originally coded to allow for highly detailed hanger bays, so originally it just used the object's bounding box, the option to define a separate box was actually an after thought.

anyway, if it works now thats fine.

on the subject I asked about the detail sphere thing because I was implementing it, I might even make a full subobject LOD in a bit.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 
Re: new animation enhanceing feature
Somehow, I can see this being used to create a lot more than just pneumatics. I think the Star Wars guys could probably recreate the Battle of Hoth now if they wanted to. ;)