Basic shape animation (logic)

2»

Comments

  • SummationSummation Member, PRO Posts: 476

    @Socks said:
    A sine wave oscillates around a value of 0

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2015

    @FlyboyTrevy_ said:

    I also just remembered I could technically rotate the actor counter clockwise, and increase the rotation value, and that would make it go both ways....

    Using your version of the code that would not solve your issue.

    The problem is you are using two sine waves (I used a sine and a cosine) and you have made the angle they both operate on equal (I deliberately made them different).

    If you change just one of your two '55' values to anything else it will break the deadlock, for example change the first one to 22. Or even just change one of the sines to a cosine, but ideally the idea of an undulating floaty thing is to introduce a sense of randomness rather than a clockwork-like constant pattern, so I'd make one of the sines a cosine and also make the two angles that sin/cos operates on different (make it so that they are not divisible by each other, so 47 and 39.6 rather than 50 and 25 or 22 and 88).

  • SocksSocks London, UK.Member Posts: 12,822

    @Summation said:
    http://www.ni.com/tutorial/4805/en/

    1. Background on Signals

    Signal modulation changes a sine wave to encode information. The equation representing a sine wave is as follows:

    Yeah, that's basically what we are doing here, modulating a sine wave (with a second sine wave).

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2015

    Thinking about this . . . .

    Because the two sine waves are in sync (both running at 55 degrees at second) when the first sine wave is at its peak (1) it is being multiplied by the second sine wave which is also at its peak (1) . . . so the total peak value is 1 (1x1).

    When the first sine wave is at the mid point (0) it is being multiplied by the second sine wave which is also at its mid point (0) . . . so the mid point is 0 (0x0).

    And when the first sine wave is at its low value (-1) it is being multiplied by the second sine wave which is also at its its low value (-1) . . . . so the low value is 1 !! ((-1)x(-1))=1 . . . so the low value of two in sync sine waves would be the same as the peak value, so values will never drop below 0 (which is why your rotating actor would only rotate one way and then back to 0°, you were only producing positive values) - and the pitch of the sine wave would effectively be doubled too as both the low value and the peak value are 1.

    Hope that makes sense !

  • SummationSummation Member, PRO Posts: 476

    @Socks said:
    Thinking about this . . . .

    What a fine day for science!

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148

    Holy pretzels Socks, what a fine day for science indeed. Yeah I get what your saying. I'll try this out when I get back to it. Thanks for being so helpful. :)

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148

    @Summation said:

    I like this thread.

Sign In or Register to comment.