Texture Animation

I wanted to preserve use of the original texture images with their vertically stacked animation frames, but also to have the animation work in a standalone x3d file that is inlined into the web page.

V-Chat geometry is stored in world.wdb files which very usefully include the names of animated textures in the form AnimXXYY, where XX is the number of animation frames in the texture and YY is the frame duration in 100ths of a second e.g. Anim0430 indicates a 4 frame animation, each frame held for 0.3 seconds.

The first step is to add a TextureTransform node to the animated texture image that scales it by a factor of XX on the y axis (which means a scale factor of 1/XX):

<TextureTransform DEF='ttAnim0430' scale='1 0.25' translation='0 0' />

Next a TimeSensor node is added that repeats at the right rate. In this case 4 frames at 0.3 seconds needs a 1.2 second cycleInterval:

<TimeSensor DEF='tsAnim0430' cycleInterval='1.2' loop='true' />

The TimeSensor output gets turned into the required texture translation coordinates by using a PositionInterpolator. This outputs a three dimensional coordinate (an SFVec3f), but it turns out that this can be routed to the two dimensional translation attribute (an SFVec2F) with no ill effects provided each keyValue is given as an x y z triple. (Lesson learned: much time wasted messing around with a CoordinateInterpolator, which doesn’t work). The example here needs:

<PositionInterpolator id='piAnim0430' DEF='ciAnim0430' key='0 0.25 0.25 0.5 0.5 0.75 0.75 1' keyValue='0 0 0 0 0 0 0 1 0 0 1 0 0 2 0 0 2 0 0 3 0 0 3 0'/>

Finally, a couple of ROUTE nodes plumb everything together:

<ROUTE fromNode='tsAnim0430' fromField='fraction_changed' toNode='piAnim0430' toField='set_fraction'/>
<ROUTE fromNode='piAnim0430' fromField='value_changed' toNode='ttAnim0430' toField='translation'/>

4 Replies to “Texture Animation”

  1. While I realize this is an older post, and probably of very limited interest, I feel like it’s worth saying:

    Even this brief tidbit of information about the .wdb file format has been very helpful in identifying what’s what. As it turns out, V-Chat 2.0 is pretty happy to run in a Windows ME, 2000, or XP virtual machine on modern hardware. The .adf metadata and hotlinks.txt are also pretty straightforward, and so with a minimum of fuss, we’ve got a server up and hosting the remaining V-Chat worlds. So, thank you for this! (My linked website has details if you’re curious; if not, please have a wonderful day!)

    • Hi Keegan, apologies for the very late response, I haven’t looked at this site for ages and didn’t realise I had comments waiting. Well done getting a server running! I’ll have a peek as soon as I get a client set up again.


  2. Just came across your site and surprised I haven’t found it prior to now. Have to say I am happy someone has finally made some progress on reverse engineering the world.wdb file format from V-Chat and am very curious if you have made any further progress. This has honestly been one of my personal white whales for quite a number of years now, going back to V-Chat being probably the biggest initial ‘internet’ experience I had in my formative years. Like you, one of my main hopes has been mainly for purely preservation reasons, but also the potential to bring these into modern applications, some VR based where I feel some of these new experience are true successors to what was envisioned in V-Chat originally.

    I do have to ask if you have any plans to post the work you have specifically on the reverse engineering of the world.wdb format even if it is incomplete?

    • Hi cro8, my apologies for having such a delinquent site and taking so many months to notice I had comments. I’m happy to share my notes on the wdb format – if you’re still interested after all this time I’ll dig them out and post them up, incomplete and speculative as they are. The workflow to get to x3d is pretty ragged and needs a lot of manual editing, hence the excruciatingly slow progress with posting up the worlds. Watch this space!

What do you think?