Procedural Dices in Houdini - Tutorial
Вставка
- Опубліковано 6 лип 2024
- In this video you will learn how to make procedural dices. These can go from a normal Dice to a DnD Dice.
This video is for people interested in learning more about Loops and Vex in Houdini. These are important to learn and for mastering Houdini.
It starts by creating a DnD Dice, the concept here is that for each primitive we get a number. That number represents the value of the side of the dice.
With a for-each loop you can loop over the primitives individual and create a number for that side of the dice.
When the loop is complete we printed out in geometry the number for each side. With a boolean you can subtract it from the original shape and get a basic dice maker.
For the second part will be a bit more VEX. It will be beginner level and will mainly make use of if statements to control what type of data should be shown.
Want to learn VEX? cgwiki: www.tokeru.com/cgwiki/index.p...
Timestamp
00:00 Intro
00:15 base shape + info
01:28 For-each Loop
04:35 VEX
07:35 Print out Number in Font
10:38 Align Number with Primitive
12:16 Boolean Number and Shape
14:29 More VEX
15:00 Grid for Dice
16:38 Get primitive attribute
18:21 Dice Nr = 1
21:00 Dice Nr = 2
22:53 Dice Nr = 3
23:07 Dice Nr = 4
23:40 Dice Nr = 5
23:55 Dice Nr = 6
24:23 Tweaks
26:19 Outro
Finally a VEX tutorial in the right pace for a houdini newbie like me. Here as well as in your other tutorials you show a great skill in teaching stuff and delivering the necessary informations! Thanks for your efforts!
A lot of information to learn from your channel, keep up the good work and we are looking forward to see more of your work
Another fantastic video! Thank you Simon! I learned a lot.
awesome stuff mate! I`m a big fan of your content. Keep making stuff like this!
Yes! A million thank you's. This is so helpful, I wish I'd found and started using Houdini ten years ago, it is still mystifying to me.
I love your videos. The vex tips and tricks are great ^^
Great Video!
Огромное спасибо) очень интересно
Very nice.
Learnt a lot from that. But as an age old table top gamer my first reaction when watching the intro animation was "Hang on! Those are all wrong!"
The sum of the opposing side of a die should always be the highest number of that die plus one. So on a six sided die, the 6 and the 1 should be opposite to each other, the 5 and the 2 etc.
(End nit-picky nerd mode)
Thanks!
Somewhere I know if I would look at real dices things would not always make sense :)
So decided to focus more on sharing interesting Houdini concepts then accurate dices.
If you can control the @number at the beginning you can get better results.
@@simonhoudini5074 yeah, I think the video does cover the important things. Picking the "right" sides based on opposing normals could be a good little addition though.
@@Bwachaauh You can get the centroid of the object using getbbox_center(), then compare if a primitive's center is below that centroid. This will give you half of all the primitives in the platonic solid. You can then run a loop over that set of primitives, comparing with the full solid to get opposite-normal primitives to get pairs. Next, the sum of opposite faces = faces + 1, so you can use the current loop iteration and that value to set the values of each face. This should give you the desired die values.
Edit: this will not work for D6, but it seems to be trivial enough to set manually.
Great video Simon, can you please do a tutorial about flow maps and how to use them within unreal?
Amazing tutorial, this is my first Houdini project and I really appreciate the level of detail you put into this. I was looking for a way to design a die that I could easily change parameters and compare for maybe a future kickstarter campaign (I intend on casting the die in copper and bronze and experiment with different patinas) and your tutorial really saved me countless hours of god knows what I would be doing instead haha. Really appreciate it man! #subscribed
I just have one small challenge at the moment, it seems like the 'official' - if that's a thing - order of numbers on the die is different than the one I arrived on. If you don't mind the question, how would you go to change that order? Thank you!
Just followed this tutorial and it was great eveything worked! Now I only have one question and that is how to go foward texturing the booleaned surface. Could not find anything online that could help. Do you have any tips for this? // J
But can you do it using vops?
Tetrahedral dice usually have a different design, where the numbers are aligned to the bottom edge instead of face center, since there is no face that points up. How would you go about doing that?
Good point!
You can use the “up” vector which Houdini will recognise by default. The rotation can be controlled by using Normal (N) and up ( or you can go to quaternions with orient attribute)
The simplest way here is to add a wrangle in the loop between the fuse and the copy to points and in the wrangle set @up
Like @up = {0,1,0}; Y is up axis is Houdini here
@@simonhoudini5074 Hi Simon, would it be possible to share a file with you for some feedback about my attempt at making a D4?
Hi, it is really a good tutorial, but I am not getting "labs thicken" node in my Houdini. Someone please help !
Make sure you have Side FX Labs installed
@26:03 I need a little help with the logic expression and where to write it, please.
In the switch you can use something very similar like in the font node.
First would be adding an attribute that holds the total number of primitives, in the first wrangle add something like @totalprim = @numprim this by default returns the total primitive nr.
Then in the switch node use this attribute by adding a spare input, just like the font node
Like prim(…)==6
@@simonhoudini5074 Thanks Simon, I did that. I have the @totalprim showing in the spreadsheet and it's showing the correct primitive value and I added the spare input to the switch with "@totalprim = @numprim;" I can't figure out how it drives the switch between 0 and 1 though. Sorry, I am new to VEX, this has been an amazing tutorial, I have had a great deal of fun following along. Had a few head-scratching moments when I forgot to change the single-pass checkbox, other than that it was an easy tutorial. And also if I may ask, how did you colour the numbers and holes procedurally? Sorry for posing a multithreaded reply, you are a great teacher, I'm learning so much from you, Thank you again.
@@magneticanimalism7419 there is a difference between VEX and expressions. So VEX is used in the wrangle nodes and expressions are used in parameters like the switch node for input.
So first thing to do is adding a spare input to the switch node and get that foreach_begin .
Then you write the expression, get attribute of the totalprim by prim(-1,0,”total”,0) and add a ==6 add the end with no spacing
For the colouring add a color node before Boolean and set colours to primitive
@@simonhoudini5074 I feel the answer is staring me in the face, the spare input on my switch reads "../foreach_begin1 prim(-1,0,”total”,0)==6" But the prim(-1,0,”total”,0)==6 is highlighted in red, I tried adding the ` like in the font node which cleared the error but the everything bellow that node broke. I'm sorry, any chance of a supplemental video on this, please? I feel like I'm asking too much though :( Sorry
@@magneticanimalism7419 the prim() function does not naturally evaluate to an integer. This causes the == operator to fail when trying to equate a float to an integer. You can explicitly set the type the output of the prim function before comparing it, using floor, ceil, round, or just (int). Try posting questions like these on odforce/sidefx forums, an image or file attachment will help others decipher your issue.