Jump to content

Learning VEX via Animated Gifs - Bees & Bombs


mestela

Recommended Posts

  • 1 month later...

Decided to look at this thread finally and it was a fantastic way to get more comfortable with animation techniques and just getting better with Vex.

Some of the older (1st page) ones were H15 so I went ahead and updated them to H16 nodes where it made sense. Cleaned up a couple bits and bobs and made some minor visual tweaks. Hopefully this will help someone else who is starting out with basic Wrangle wrangling.

Most of this is direct ports of Matt's work, with some contributions from iamhoy and some chitchat on the Discord forum.

-Robert

 

beesAndBombs_01_columns.hiplc

beesAndBombs_02_twistingBox.hiplc

beesAndBombs_03_waveGrid.hiplc

beesAndBombs_04_twistingCubes.hiplc

beesAndBombs_05_dancingOrbs.hiplc

beesAndBombs_06_bounce.hiplc

beesAndBombs_07_swirlBall.hiplc

beesAndBombs_08_circleWave.hiplc

Edited by RobertHodgin
added incorrect file...
  • Like 4
  • Thanks 2
Link to comment
Share on other sites

Three more before the weekend starts.

For the Dot Inversion one, I opted to leave out the camera cheat trick (even though it was pretty damn clever) and just look at the Vex version.

And for Dancing Squares, @iamyog did a great pure-Vex solution but I made it a little less reliant on Vex. Definitely check out his solution too.

Let me know if I made any mistakes or if my crediting is incorrect.

beesAndBombs_09_twoWorms.hiplc

beesAndBombs_10_dancingSquares.hiplc

beesAndBombs_11_dotInversion.hiplc

  • Like 1
Link to comment
Share on other sites

On 03/07/2017 at 8:32 AM, henderthing said:

I've uploaded a simple way to make a perfect sphere this way. I made no attempt to match original proportions, etc. Just to demonstrate some principals. VEX is commented.

I broke the @P.y out into separate lines so that you can comment out the lines at the end to see what each step does.
As for simple flat color like this-- use the "old" Constant shader in SHOPs I've done that in this file, and assigned color via the prim wrangle sop.

Cheers
-matt

b_and_b_cubewave.hiplc

Thanks Henderthing! I still hadn't figured out how to get solid colours. No amount of googling was helping. I do predominantly motion graphics work, and this is going to be really helpful. 

Link to comment
Share on other sites

Here is one that I did quite a while ago, but didn't share because I couldn't figure out how to render solid colours. But, now that Henderthing cleared things up for me I thought I would put it on. 

Original here: 

https://dribbble.com/shots/2726044-Rainbow-Ring

My version:

Rainbow_Ring_01.gif.4a1e846375e35db093aca6e11b5091d4.gif

I'll admit that I once again did a bit of colour work to it. This time in Photoshop. You'll notice the original has more representation in the RGB colours and the HIP file version is heavy on magenta, yellow and cyan. This could probably be done in VEX by adding adding an easing function to the R, G and B channels seperately. But I haven't taken the time to do that yet. Could be a fun exercise, though. 

I've also included a version of the dancing orbs, as I came to a different solution to the original one on here. So, it could be useful for others to see a different implementation. 

RainbowRing_01.hipnc

DancingOrbs_01.hipnc

  • Like 4
Link to comment
Share on other sites

Hi Clif-

I took a look and thought I'd take a quick stab at this and make a couple comments.

No need to "declare" new attributes in a wrangle SOP. That's all handled automatically--you can just go and set your new @myattribute to a value.

While copy stamping is no problem for something this small-- I generally avoid it these days as it doesn't scale well. Most of the functionality can be handled much (much!) faster by the fully threaded wrangle SOPs.

I built it this way next to your network in the attached file...

Cheers

-m
 

RainbowRing_02.hipnc

Link to comment
Share on other sites

  • 3 weeks later...

Thanks again, henderthing. It took me forever to notice that you used @primnum. For some reason I kept seeing it as @ptnum. Once I did notice it, I had no idea why there would even be primitives. I'll admit, I've used the 'ends' node before, but had never notice that it leaves behind an invisible primitive. In fact, the idea of having a primitive that exists as neither a surface nor an edge (line) threw me, too. I didn't know that was a thing. 

These exercises are actually the first I have ever used the modulo operator, so it also took me a bit to dissect how your 'cu' equation was working. This is much cleaner than my @k method, but certainly a lot more difficult for a beginner to grasp! 

After I figured those parts out, the rest fell into place and I was a little embarrassed that I had stared at it for so long, wondering what the hell was happening. LOL. 

What I learned: 

1. You can have primitives that exist as neither surfaces nor lines. 

2. There is a relationship between points and primitives. By which, I mean, a point seems to 'belong' to a primitive and you can use this to manipulate the points. Probably should have known this, but didn't.

3. More elegant usages of the modulo operator. 

4. Got to brush up on some pretty basic trigonometry. 

Question: 

Why can't I do: 

float divp = 1/@numprim;   [returns 0 instead of number expected]

and instead need to do: 

float divp = @numprim;
divp = 1/divp;

I also noticed your method opened up the possibility to very easily make the number of sides procedural, too. So, I've attached that here.

 

RainbowRing_03.hipnc

Link to comment
Share on other sites

Clif-

1. In my network, I create a circle and use the ends sop to get rid of the face (n-gon). The "unroll" option gives you a polyline with coincident points at the start/end. Then I copy it 4 times. This gives me 4 primitives, each of which is an open polyline. I use $PI/2 * primnum (90 degrees) to initialize the 4 corners of the square cross-section. All the way up to the skin SOP, there are 4 polylines--each one a primitive. They just look like a single curve because of the way I've rotated the points. You can see this by doing something like @Cd=random(@primnum)... So-- there are primitives here-- and they are actually polylines.

2. Yes--but you need to be careful. In the case of a quad poly surface (poly grid, for instance)--each quad will have a vertex at each corner, but each point will be a collection of 4 verts, each belonging to a different poly (primitive). So--in a pointwrangle, which primitive number will you get with @primnum? Guessing here, but probably the lowest one.

3. modulo is super-useful!

4. Trig, vectors, linear algebra, analytic geometry and calculus are all super-useful. And Houdini/vex makes it much easier to get a handle on these things.

The reason 1/@numprim doesn't work is that your numerator and denominator are both integers. I'm lazy--and rather than cast them with float(), I just type: 1.0/@numprim. The 1.0 is a float, and you will get a float. There may be a reason for not doing this, but I've never had problems with it.

 

Hope this helps
 

Cheers

 

-m
 

  • Like 1
Link to comment
Share on other sites

  • 3 months later...
  • 4 months later...
2 hours ago, smbell said:

No matter what I fiddle with, I can't seem to get my viewport in a fresh scene to show the curve width. The attribute is there and it will render in mantra. What's the trick to that?

 

Cleverly located in the Misc tab, object parameters: "Shade Open Curves in Viewport"

 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

Playing around and trying to replicate Ryan's cube  

One thing missing. There is an apparent acceleration as the object gets closer to camera.
I have tried to compensate for it by making the translation to camera exponentially slower (using as exponent the scale factor of the fractal*), but it still doesn't look right. 
   

@iFight4theUserhow did you manage to make it look linear? 
I am not sure if we used the same method so I have attached the hip file.
Thanks for helping!



*scale factor of the fractal is the scale ratio at which you will "see" the same shape. 
For example, the cube stack is created by copying the cube and scaling down 0.3

cube_fractal_v02.mp4

cube_fractal_side_v02.mp4

spigoli_v08.hip

Edited by WLVL
fixed bug on the hip file, note: make sure you have gamedev / sidefx lab installed.
Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...