New Node - Oscillate - Set Range For Object To Rotate

Discussion in 'BBNodes' started by LBPToo, Sep 1, 2018.

  1. LBPToo

    LBPToo Avid Boxer

    Joined:
    Nov 1, 2016
    Messages:
    233
    Likes Received:
    141
    Oscillate Node: Allows you to set a range of rotation and the object will rotate back and forth within the range at the speed you set. You can set all 3 axes if you want/need to and the object will rotate in all axes set. A Speed and start/end angles must be set for it to rotate in that axis.

    Attributes:

    Speed: Set speed object moves between the range set in the following attributes;

    Start X Angle: Set starting point for rotation of the X axis.

    End X Angle: Set ending point for rotation of the X axis.

    Start Y Angle: Set starting point for rotation of the Y axis.

    End Y Angle: Set ending point for rotation of the Y axis.

    Start Z Angle: Set starting point for rotation of the Z axis.

    End Z Angle: Set ending point for rotation of the Z axis.

    Keep Start X Angle: With this checked, rotation will start from the original object's X direction and use that as the Start X Angle and add the range to get the End X Angle.

    Keep Start Y Angle: With this checked, rotation will start from the original object's Y direction and use that as the Start Y Angle and add the range to get the End Y Angle.

    Keep Start Z Angle: With this checked, rotation will start from the original object's Z direction and use that as the Start Z Angle and add the range to get the End Z Angle.

    Enclosed is the BBDOC, Test Oscillate Node, with the node in it so you can test how it works.

    NOTE: I have now added a bbasset to the enclosed zip file so all you need to do is drag the bbasset into your 3D World and it will create a new object in your object list with the node included. You can either use that object or copy and paste the oscillate node into another object.

    I’ve uploaded a video showing the node in action.






    Bill
     

    Attached Files:

    Last edited: Sep 22, 2018
    ZackGriset, PLASSA and Jackazoid like this.
  2. PendingFox

    PendingFox Boxer

    Joined:
    Aug 21, 2018
    Messages:
    17
    Likes Received:
    6
    The Video is down
     
  3. LBPToo

    LBPToo Avid Boxer

    Joined:
    Nov 1, 2016
    Messages:
    233
    Likes Received:
    141
    Thanks PendingFox, it's working for me, is it back up for you?
     
  4. PendingFox

    PendingFox Boxer

    Joined:
    Aug 21, 2018
    Messages:
    17
    Likes Received:
    6
    Yep :/ here's the screen
     

    Attached Files:

  5. PLASSA

    PLASSA Boxer

    Joined:
    Jun 5, 2018
    Messages:
    24
    Likes Received:
    6
    Damn you are just pumping these out!
    Amazing work LBPToo, keep it up!

    edit: thought you'd like to know that for me like fox, the video is also down
     
  6. LBPToo

    LBPToo Avid Boxer

    Joined:
    Nov 1, 2016
    Messages:
    233
    Likes Received:
    141
    Thanks PLASSA.

    Weird that it's down for both you guys and up for me. I'll put link here that should run it on YouTube. See if that works for you:

     
  7. LBPToo

    LBPToo Avid Boxer

    Joined:
    Nov 1, 2016
    Messages:
    233
    Likes Received:
    141
    Try it now. I had the rights wrong on YouTube.
     
  8. PendingFox

    PendingFox Boxer

    Joined:
    Aug 21, 2018
    Messages:
    17
    Likes Received:
    6
    Yep it works now in both OP and your pre-last post. Oh and looks great keep up a great work.
     
    LBPToo likes this.
  9. LBPToo

    LBPToo Avid Boxer

    Joined:
    Nov 1, 2016
    Messages:
    233
    Likes Received:
    141
    Update node: My report of the Y and Z parameters being reversed was wrong. It was a result of me not noticing(and still not understanding) that the X and Z axes are parallel to the grid and the Y axis is perpendicular, unlike Blender and what I'm used to, but the same as Unity, so there must be a good reason for it.. This was the source of my confusion. I have updated this node to take this into account. This also includes the oscillate and camera follow nodes.
     
  10. LBPToo

    LBPToo Avid Boxer

    Joined:
    Nov 1, 2016
    Messages:
    233
    Likes Received:
    141
    Here's a bbasset for the oscillate node. Don't know why I didn't think of this before.

    NOTE: The zip enclosed with the original post in this thread now contains this bbasset.
     

    Attached Files:

    Last edited: Sep 22, 2018
    particles likes this.
  11. mxstudios

    mxstudios Boxer

    Joined:
    Aug 30, 2016
    Messages:
    51
    Likes Received:
    13
    @LBPToo ,

    Does this.entity.rotation() work on a physics object? Or do I need to use AngularVelocity? I want to limit the roll to a max angle like you did here, but when using setAngularVelocity I can't seem to read the current angle. When I try and set the rotation, like you've done, it does nothing. I am assuming that's because I have physics turned on?

    The angularVelocity() api call returns the value it was set to, and not the current amount it has rotated.
    Thoughts?
     
  12. LBPToo

    LBPToo Avid Boxer

    Joined:
    Nov 1, 2016
    Messages:
    233
    Likes Received:
    141
    Correct, it does not work on a dynamic physics object. It should work on static and kinematic. Offhand I don't know how to do rotation on a dynamic physics object, but I'm sure you're going in the right direction(no pun intended) with angularVelocity.
     
    ZackGriset likes this.
  13. mxstudios

    mxstudios Boxer

    Joined:
    Aug 30, 2016
    Messages:
    51
    Likes Received:
    13
    I’ve got the rotation part down, but can’t figure out how to find out it’s angle. Even if I could get position relative to ground it would help. But it doesn’t seem to work.
     
  14. LBPToo

    LBPToo Avid Boxer

    Joined:
    Nov 1, 2016
    Messages:
    233
    Likes Received:
    141
    I just play with the beginning and end point until I get the range where I want it. It's hard to tell exactly what you're dealing with without seeing it.
     
  15. Ahmad Naamneh

    Ahmad Naamneh Boxer

    Joined:
    Dec 24, 2018
    Messages:
    38
    Likes Received:
    4
    Its working on Y Axis only :( did i do anything wrong? here is my sittings Screenshot 2019-01-05 22.51.23.png
     
  16. LBPToo

    LBPToo Avid Boxer

    Joined:
    Nov 1, 2016
    Messages:
    233
    Likes Received:
    141
    Hi, I'll try to get some time to look at it but I'm swamped right now and can't look right away.
     
  17. LBPToo

    LBPToo Avid Boxer

    Joined:
    Nov 1, 2016
    Messages:
    233
    Likes Received:
    141
    I just tried it in my original test doc and it worked fine, then I looked at your screen shot and you don't have the attributes correctly set. You changed the speed of the rotation to the Z axis, but you didn't move the start and end Y axis values to the Start Z and End Z angle attributes. That should fix it.
     
  18. Ahmad Naamneh

    Ahmad Naamneh Boxer

    Joined:
    Dec 24, 2018
    Messages:
    38
    Likes Received:
    4
    Yeah, you right, now i understand that one, thanks for the helpful asset
     
  19. LBPToo

    LBPToo Avid Boxer

    Joined:
    Nov 1, 2016
    Messages:
    233
    Likes Received:
    141
    Sure, glad you can use it.
     
  20. Bluemusic

    Bluemusic Boxer

    Joined:
    Apr 7, 2020
    Messages:
    59
    Likes Received:
    10
    Hi. I found this thread and I was looking for a node like this but I am having problems with adding opposite degrees. I´m making a bird with wings and they move up and down on the opposite angle, but I am not able to do the opposite because the node won´t do degrees on the negative scale....as far as I have tested (spent 3 hours to see if it worked:) I have tried to take opposite speed om z axis, setting start point and also doing opposite on angles. I have tried to copy the object and turned it around but the wings are getting messed up.
    Is it possible?
     

Share This Page