[x3d-public] Super simple animations?

John Carlson yottzumm at gmail.com
Mon Aug 7 00:17:04 PDT 2023


Okay, here's what I've got with Event Utilies so far.  I'm guessing that
this isn't working because the Switch is not sending events to the
startTime field to the selected child, and stopTime to the other animations
in the Switch.  This is as far as I've gotten with my intuition, and not
doing a lot of repetitive coding.

DEF EverythingAnimation Group {
 children [
        DEF EverythingTimer TimeSensor { cycleInterval 10 loop TRUE enabled
TRUE } # set_bind "ToddlerView"
 ]
}

ROUTE Everything_Touch.touchTime TO StandTimer.stopTime
ROUTE Everything_Touch.touchTime TO PitchTimer.stopTime
ROUTE Everything_Touch.touchTime TO YawTimer.stopTime
ROUTE Everything_Touch.touchTime TO RollTimer.stopTime
ROUTE Everything_Touch.touchTime TO WalkTimer.stopTime
ROUTE Everything_Touch.touchTime TO KickTimer.stopTime
ROUTE Everything_Touch.touchTime TO StopTimer.stopTime
ROUTE Everything_Touch.touchTime TO RunTimer.stopTime
ROUTE Everything_Touch.touchTime TO JumpTimer.stopTime
ROUTE Everything_Touch.touchTime TO EverythingTimer.startTime

DEF mySequencer IntegerSequencer {
        key [ 0 0.9 1.1 2.23 4.3 5.5 6.3 7.3 8.5 8.6 10 ]  #
Leif_humanoid_root_TranslationInterpolator x 10
        keyValue [ 0 1 2 3 4 5 6 7 8 9 10 ]
}
DEF mySwitch Switch {
        whichChoice 0
        children [
                USE StandTimer
                USE PitchTimer
                USE YawTimer
                USE RollTimer
                USE WalkTimer
                USE RunTimer
                USE JumpTimer
                USE KickTimer
                USE StopTimer
                USE StandTimer  # repeat, here, TODO
                USE PitchTimer
        ]
}
ROUTE EverythingTimer.fraction_changed TO mySequencer.set_fraction
ROUTE mySequencer.value_changed TO mySwitch.whichChoice


On Sun, Aug 6, 2023 at 9:02 PM John Carlson <yottzumm at gmail.com> wrote:

> Sorry, I tried to paste, but I sent the previous message instead.  To
> continue:
>
>
> https://stackoverflow.com/questions/7662518/vrml-route-as-a-parameter-in-proto
>
> describes how to send ROUTE to a PROTO, but it uses Script. Is there
> another solution?
>
> Thanks!
>
> John
>
> On Sun, Aug 6, 2023 at 8:58 PM John Carlson <yottzumm at gmail.com> wrote:
>
>>
>>
>> On Sun, Aug 6, 2023 at 8:40 PM John Carlson <yottzumm at gmail.com> wrote:
>>
>>> Understood that I don't need script.  Understand that I suffer from
>>> carpal tunnel and I don't want to waste a lot of time editing duplicate
>>> code.  Maybe we can do something like IMPORT/EXPORT or prototypes.
>>>
>>
>> I'm thinking I can declare a PROTO, say JumpAndRunAnimation, and pass 2
>> SFNodes (or an MFNode) which contain the Animation Groups.  I'm hoping that
>> this will create a separate namespace for the interpolators and TimeSensors
>> found in the Animation Groups. After I pass in the Animation Groups, I use
>> event utilities to chain the animation groups passed into the proto in
>> order.  I'll have to somehow do the chaining between Animation Group
>> TimeSensors in the PROTO.  I've not done PROTOs in VRML yet, so this should
>> be a challenge.  Hmm.  Is that all?  How do I do chaining on any number of
>> Animation Groups?
>>
>> Where do I put the ROUTEs that turn on one Animation group and turn off
>> the other Animation groups?  In a Switch?  Does that work?   Can I pass a
>> similar list of ROUTEs to the PROTO?
>>
>>
>> Thanks!
>>
>> John
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230807/6f732c63/attachment-0001.html>


More information about the x3d-public mailing list