Showing posts with label 3D. Show all posts
Showing posts with label 3D. Show all posts

Tuesday, 10 June 2014

Major Project Update

I've finished the major project as a combination of some works that fit with the IWP I did, and some works which are less architecture interactive and more general.

A brief rundown of the work that I've been doing:

I streamlined my VideoSquarees and added significantly more clips (pretty much doubled the number of clips available.

I updated some of my projects to include use the NSWindower system (which is a bitch to use because it means actually learning all of Apples development systems).

I added a 3D sketch of the Joints application, with fractal branching and 3D collision physics with ofxMSAPhysics.

I also created a new video project to generate an infinite business advetisement.

EDIT:
I've finished the business advertisement.


Thursday, 20 February 2014

Spherical

I've been playing around with meshes in oF and I found a cool algorithm to create a 3d sphere of points using segments and a radius here. I also found a way to scramble the points from the set segment line by changing a variable.

I used the product of the points position relative to the centre of the sphere and an array (see C++ vector) of scaled noise values to change the position of the points.

Once I had the positions moving and changing to noise I added the other drawing modes like applying a subsection of the noise array to entire rows of the sphere.

Then I applied a mesh to the points in the sphere and drew the mesh to screen

I also added a simple UI for control of the object, along with lighting, and colour between the vertices.

At this point it looked a bit like this:



Also I used this method of getting normals for the faces of the object:
for all the vertices in the mesh except the first and last, add a normal at the normalized vector of the perpendicular between the previous and the next vertices.
Then I tweaked the lights a bit and considered the project finished, however I kept having problems with the addon I used to do the UI (ofxSimpleGuiToo) not saving the settings sometimes and not loading them from the XML file correctly (for some unknown reason, I think because its not compatible with oF 0.8.0)

I also wanted to implement some post processing fx. I hunted around for a bit and found ofxPostProcessing, and then implemented it.

By this point ofxSimpleGuiToo was having a conniption and wouldn't do anything that I asked of it and so I decided to upgrade to the elegant but slightly more complex, ofxUI, which is by far the superior technology.

Here are some screenshots of the finished product, along with a demo video:












Spherical Demo from Gareth Dunstone on Vimeo.

Friday, 11 October 2013

The ArrayCube

This project started as a quick sketch with Nick Noble, a COMP1720 student, to learn about arrays.

We created a cube object, gave it some values, a vector location and stuff. And whacked it into a 3d array, drew them all. And as soon as you know it we have some weird stuff like this:



And thats all great. But I liked this. I wasn't happy with all the crap that Processing was giving me.
"Only 8 lights" they said.
"You're drawing too many cubes" they said.
So I started porting it to openFrameworks:







Now look at me, creating classes in C++ for glory. 
Problem is that its even slower. 
WHATS THAT OPENFRAMEWORKS? YOU'RE EVEN SLOWER THAN PROCESSING?
So I did a few more iterations:



Made some changes:



But still, why is this crap running so slow?
C++ doesn't treat variables like Processing does. Assigning a value (using =) makes a copy of it. And I have a problem with that. I'm drawing many, many cubes. Like a lot of them. All of the cubes. And I want them to just grab some value from somewhere else to use as their opacity or brightness or whatever the hell I want to to be.

I needed to start using pointers.

I started using pointers. Things got faster.
I started using more pointers. Things got much faster.
I used pointers in a class, had them coming out my arse.
I set *my = &day and filled it with win.
I pointed at 0x4632b2b and fucking killed it.
And so now I'm like:
"HELL YEA! I CAN DO THE POINTER DANCE! EAT MY SHORTS, PROCESSING!"
But I was still not fully pleased. It was missing something. Some kind of other input and interaction with its surroundings that would make it whole. I looked high and low. I googled this and I googled that. 
And then it struck me.
"WE NEED SOME DSP ALL UP IN THIS BITCH!"
 And after learning very quickly how to use openFrameworks' ofSoundStream I finalised the code for having it not only play sound (End Theme by Zero 7), but react dynamically to sound input.
And this is the result: