top of page

2. Nature of Code

  • Writer: Astro Lee
    Astro Lee
  • Feb 9, 2024
  • 2 min read

With this week's vector assignment, I wanted to revisit my 3D random walk again to iterate it, maybe potentially develop it & organize it using the p5 createVector() function.


I encountered a few hurdles (since arrays, classes, push and pop is still a new concept to me) with storing the position data while reorganizing my code with the vector function, but it definitely seemed much neater after I've went in and replaced the long lines of code into a shorter condensed neater version.

--> A video of my new developed p5 sketch, with vectors. Doesn't seem a whole lot different, but the code makes much more sense, and is a lot cleaner, which I am very happy about.


I also read on the p5 Reference page that OrbitControl() function has its own capabilities for camera trucking in & out with the mouse. I zoomed in and out of the scene(?) and was able to play around with it a lot more then the previous versions of my random walk sketch.


Then I tried playing around with the fill() function inside the array & for loop. It was tricky, since I knew the easy way to do this in Houdini, but never really thought this through deeply through it code-wise. (I wanted to make the cubes be different colors as they were born. I understood in theory that the individual boxes need IDs, but I didn't know how to assign them. I'm sure the future classes will go over this area. --Also an indication that it's time for me to dive into Coding Train again)

ree

(It looked cool though.)


Then again, I played around with color. I used my favorite color blue, by tinting it with the light in the WEBGL space / p5 function.


v The orbit control function I was inspired by (An example from the p5 reference page)

ree

And, there! Although not fancy, yet it was a functional, productive assignment. (I think :b)



And soon again, p5!

(+ My sketch for this week)
























------------------------------------------------------------------------

And not-but maybe? vector related experiments I did with Houdini:

I had noise drive the color(@Cd -vector3) & position(@P -vector3) of the mesh, and played around with it in my native software.


(Noise-driven coloring on Pig) - slowed down

ree

(Simplex & Perlin Noise deforming the Pig mesh)



(Converting the deformed pig into a volume)

--> Looked like a heart, which I found very interesting. It looked like it was thumping in a very organic pattern.

ree

(Then converted that into polygons)

ree

(Subdivided it to be smoother)

ree

(Rendered it -mid way- as rough glass)

ree

(Screenshot-ed preview as gold blob)

ree

Took a screen recording of what it would look like if it were to be rendered. Not actual render. Just a viewport-grab.


An interesting experiment!

Now, Ciao once again, blog!

Recent Posts

See All
Thesis First Play Test

The first play test took place in the BallRoom. I tested ml5 vs. OF HaarFinder vision model in a dim light situation, on a mac and a...

 
 
 

Comments


bottom of page