How to put a max number to the frame node?
I am very new to Nodebox, but I feel like I am getting the hang of things -- but I am having trouble creating animations that allow for a variety of sequences/scenes over the course of the animation. I wish there was a node that capped the frame node from continuing to grow past a certain number. (I apologize if I am being silly and somehow there is already a node for this.)
Is there a way to set up the frame node to an ellipse to make it grow and eventually stop growing? Would this involve a very complex subnetwork? A special equation? Do I need to get smarter and figure this out like an adult?
I included my project below. In the animation, I wish for the circle to stop growing at frame 1,000.
- Divided.ndbx 4.84 KB
|?||Show this help|
|ESC||Blurs the current field|
|r||Focus the comment reply box|
|^ + ↩||Submit the comment|
You can use
Command ⌘ instead of
Control ^ on Mac
Support Staff 1 Posted by Frederik De Ble... on 11 Aug, 2015 06:48 PM
The frame node, by itself, just keeps growing. The trick is to append a node after the frame node to do what you want. I see two possible options:
mod(for "modulus") node. Connect frame to the first port (
value1). For the second port, use the maximum value you want to use. The
modtakes the remainder of the division, and as such, will never be larger than the second value. That means that when the frame reaches zero, the mod node will wrap back to 1.
minnode. This takes the minimum of a list of values. So if your frame is 1200 and your fixed value is 1000, the minimum will be 1000. Since the
minnode takes a list, you'll have to build a list first using a
numbernode and a
combinenode. The screenshot below demonstrates that.
Of course, for both approaches, you can use the output to do something different: for example, divide that value by 10, or add a certain number, or whatever.
I've attached a network that shows both approaches.
2 Posted by shanejez on 12 Aug, 2015 02:36 AM
Thank you for this. It really has helped me get over a bump in the road!
I really appreciate the prompt response.
Support Staff 3 Posted by john on 15 Aug, 2015 08:19 AM
Welcome to the NodeBox community! I've been here for about six months and have gotten into all sorts of mischief.
I do a lot of projects with complex, multi-stage animations and along the way I've developed a few techniques to make it easier. Frederick's suggestion of using a Min node is a simple solution to your immediate problem, but there is another node you should know about: Convert Range.
The Convert Range node takes one range of values and interpolates it into a second range. If you feed it a Frame node, you can use it to precisely control your animations. Set Source Start to the frame you want to begin at and Source End to the frame you want to stop at. Set your Target Start and End to whatever values you need to make your animation do its thing.
To illustrate my point I made a quick three-part animation similar to your growing dot. I have attached the animation as an MP4 file along with a screenshot and the NodeBox network that made it. The choreography is as follows:
Frames 1-50: a small dot sits on the screen not moving
Frames 50-150: the dot swells in size from 10 to 300
Frames 150-200: a second dot appears to the right and grows to size 30
Frames 200-220: a brief pause to build suspense
Frames 220-420: the second dot orbits the first
Frames 420 on: the show is over
All of this was done with three Convert Range nodes to define how long each movement lasts. The entire thing was done with only nine nodes. The Convert Range node makes animation a lot easier!
I look forward to seeing some of your animations in the Show Your Work forum.
4 Posted by shanejez on 15 Aug, 2015 01:44 PM
This is exactly what I was looking for! (https://vimeo.com/136345713)This is what came out from using the MIN node which ended up working out really well, but as you mentioned – it resulted in a very thick bush of nodes (I should have made a subnetwork, but I was a bit too “in the moment” when designing it)
I will give a new animation a try using this node. Thanks again! Is there a Nodebox area for submitting nodebox made work? I really wish I could see what everyone (such as yourself and Fredrick) are working on.
Support Staff 5 Posted by john on 17 Aug, 2015 04:42 AM
Glad you found that helpful. I enjoyed your video and also checked out your site. Nice stuff! I think you will have a blast with NodeBox.
The section next to this one in the NodeBox Forum is called "Show Your Work". That's the place to share your latest creations. You can attach MP4s, screenshots, and ndbx files if you want. I've posted various things there, more to share concepts than show art, but that's just me. It's one of the best ways of learning how to do things. I would post more often if we had a more active community.
Support Staff 6 Posted by lucasnijs on 20 Aug, 2015 06:54 AM