![]() Each one has its benefits and I wouldn't suggest using solely one or the other. Hopefully this cleared up any questions you may have had about VEX and VOPS. It looks decent when rendered goes to show how we can create geometry from some code. I decided to render the two spirals intertwining as different colors. Each one gives us a spiral that we can do whatever we want with. However, when we're done, we end up with the exact same setup. In the VOPS code, we get the values as we use the nodes that calculate them. In the VEX code we did things like float r float x,y float theta etc and then gave them values later. Another difference is the lack of our initialization of variables. This is then used as we have used our Pi value in our VEX code. This spiral takes a slightly different approach, for example, to find Pi, we use an Arc-Cosine node with a value of -1 which gives us Pi. So, once we've created our VEX Spiral, we move onto the VOPS spiral. That covers the basic explanation of the above code. ![]() We then use the addpoint function to add a point to geometry stream 0 at position pos. The pos value is simply a vector that tells us where to put our point. ![]() Once we have our x and y values, we can set our pos value. We use the sine and cosine functions to derive the value on the unit circle from theta. We then use the theta and r values to calculate our x and y values. ![]() If you want to watch me struggle to come up with this, you can watch this BONUS VIDEO (we might make it public in the future, but for now here's a reward for all the reading).īasically, r is the amplitude of the curve whilst theta is the angle to use for calculating the position on the curve. The two variables above are calculated based on some math that I researched for another project. Every time we run the code in the brackets, we will increment i (i++). The i value starts at 0 and as long i is less than our points variable, we will run our code. In this case, we create an integer called i ('i' is the usual name because it is short for 'index' or 'iteration' in some cases). and finally two floats called 'x' and 'y' which we initialize as 0. float r float theta vector pos = set(0,0,0) float x,y = 0 Ībove we create more variables a float called 'r' with no value (called a null value), a float called 'theta' with a null value, a vector called 'pos' that is initialized as (0,0,0) which would be the origin in world space. If these do not already exist, Houdini will create them for us and we will be able to adjust them with corresponding sliders. In this case, we are telling Houdini that we want a channel integer called 'points' and a channel float called 'angle'. We can set variables to any value that matches their type. The above code creates an integer called 'points' as well as a float called 'angle'. int points = chi('points') float angle = chf('angle') Let's quickly run over the code from this tutorial. However, the code that it generates is a bit convoluted as it is computer generated and not really formatted for humans even though they have tried to make it readable. Houdini even let's you see the generated code if you want. VOPS generate the VEX code at the end - behind the scenes. You can do everything in VOPS that you may want to do in VEX. Except, they are chunks of VEX code that have been packaged into neat little nodes that you can use. Now, what are VOPS? Basically, they're VEX. These attributes can be position, color, normals or literally any other attribute you may want to affect. Sometimes you'll adjust attributes directly, other times you'll do a couple of steps before the actual attribute is affected and those steps get discarded after the wrangle has done it's job. Once we have done our calculations, we can either add/remove/edit attributes or groups based on the calculations that we have done. However, a simple way to view VEX is - you create a bunch of temporary values known as variables that we can use to do calculations. This isn't intended to teach you VEX as we will be releasing a full series on VEX. These allow you to do calculations, add or edit attributes/groups and do various other things. English and German have similar syntax but Chinese is very different) similar. I began coding in C# and that made my shift into VEX easy as they are quite syntactically (grammar of coding eg. We can control attributes, parameters, nodes and more with VEX. It allows us to control a plethora of aspects of Houdini. VEX is the coding language used in Houdini. To start with, we need to understand what VEX is. This will give us a good idea of the pros and cons and which one is better suited to you as a Houdini artist. We are creating the same setup in both VEX and VOPS. In this tutorial, we are comparing VEX and VOPS and going over the differences and similarities of each. Welcome to the VEX and VOPS comparison tutorial.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |