Archives For words

I’ve been having a serious look at using spheres and also boxes to represent the collision
shape in bullet simulations. Spheres are great in that you can rely on the geometry to not get caught and hang on to each other. Boxes offer a nicer settling motion in certain setups too. The main reason I wanted to look at it, was to avoid always needing to use glue constraints. Sometimes I want a nice quick voronoi fracture that uses the clustering option, and this yields shitty collision approximations with convex hulls.

Enter vdb sphere packing! It allows me to fill the wacky geometry shapes and use those as colliders. I just save out my points, and transform the original pieces. Voila!

vdb_sphere_packing

Dot Product & Normalize

September 25, 2018

These are two of the most used functions in Computer Graphics, and quite a lot of the time, the underlying process of how it works, is ignored.

Normalizing a vector is essential for a variety of reasons, and below is the long way around to do it, as opposed to the normalize VOP.

normalise_long_form_point_vop

We need to find the length of the Vector, as this will be used as the divisor for the x,y,z components of the Vector to be normalized. This is done by taking the x,y,z components and taking each to ^2 power. Then we add those values together and find the square root. Now we have the length of the Vector, and  can use it as the divisor. Voila!

Now it’s time to do the Dot Product! Mysterious I know. But very handy in shading/lighting and other areas of Computer Graphics. The Dot Product is the Cosine of two normalized vectors. Cosine being the trig function equal to the ratio of the side adjacent to an acute angle (in a right-angled triangle) to the hypotenuse. That’s pretty neat!

Below is a quick animation of the Cosine around a unit circle. The unit circle being a radius of 1 of course. The Dot product of two normalized vectors, which we will see is just multiplying their components and adding them together, creates a trigonometric function.

Here is the long way of doing it, instead of using the dot product VOP.

dot_product_long_form_point_vop

First we normalize both Vectors. Then we split the x,y,z components of each vector and multiply them. Adding the results of this all together. Bingo! Very Simple really isn’t it. Additionally, using a trig VOP to use arc cosine along with a radians to degrees, will give you the actual angle between those two vectors.

 

I Have been working on this for the last six months.

2018 Reel

July 2, 2018

Blah blah, doesn’t have the awesome work from current projects, but it’s not too bad.

1.) Grab the latest studio pro download for Linux. (12.5.x) as of writing, but  I’m using 13.1.7 alpha.

2) Extract the contents, I’ve just gone “/home/dude/Downloads” and make a new folder in your home directory, “/home/dude/programs” for example.

3) Open a terminal and cd to “/home/dude/Downloads/3delight-13.1.7-Linux-x86_64” and run the following: “./install –prefix home/dude/programs”

4)cd to /home/dude/programs/3delight-13.1.7

5)run: “unset DELIGHT”

6)run: “source .3delight_bash”

7)cd to home

8)sudo gedit .bashrc (and add the following lines)

# set DELIGHT path

export DELIGHT=/home/dude/programs/3delight-13.1.7/Linux-x86_64
source /home/dude/programs/3delight-13.1.7/.3delight_bash
#

9)I had issues with these env variables not being present, so set these too, with the following command.  “export MAYA_PLUG_IN_PATH=/home/dude/programs/3delight-13.1.7/maya/2017/plug-ins”, and MAYA_SCRIPTS_PATH, DL_DISPLAYS_PATH too.

10) Set the frame buffer to be i-display in 3delight prefs in Maya, before you render, or it will crash Maya.

I launch Maya from a terminal, that way everything is set right. Also, if you plan on adding your own custom OSL shaders, set this env too.

_3DFM_USER_OSL_PATH

Voila!

3delight_13_test_v001_nsiRenderSettings1_0001_7

 

 

 

 

 

 

 

Not mine, but I trimmed what I needed. Great to add to your shelf, and make a shortcut.

node = hou.pwd()
for i in hou.selectedNodes():
if hou.nodeTypeCategories().keys():
### Above function lets you call this function on any context ###
dir = i.parent().path() + ‘/’
selNodeName = i.name()
nodeinfo = i.type().name()
nullnode = hou.node(‘/%s’%dir).createNode(‘null’, ‘OUT’)
selNodePos = i.position()
nullnode.setColor(hou.Color( [0,0,0] ))
### Setting node position ###
nullnode.setPosition(hou.Vector2(selNodePos[0],selNodePos[1]-1))
nullnode.setInput(0,i)
i.setSelected(False)
nullnode.setSelected(True)

Colour Constructor

December 27, 2017

Really neat tool, and super cheap too.

Colour Constructor