V

Avatar



hmm.candles

I made this after Sunflower‘s release but never got too serious about it. Just today i was listening to Fout Tet (again), and this track – Harmony One – from their Pause album just made me smile. Maybe for those background sounds, reminded me the days i was working on [We.are.in.Helsinki]. It actually sounds like some sounds S* made for it. Anyway i went to find the old project and ran it over the music. Well it came out ok, so i made a video of it. Enjoy.





hmm.

In the past few days i was playing with voronoi cells. in the meantime i had another idea i wanted to try: random recursive cell growth. So i started working on both pieces together and came up with what you’re about to see in the videos below.

The scene is rendered using a per-pixel phong lighting model + wrap lighting, a fast trick to approximate subsurface scattering. More information available in  the GPU Gems book.

I have used lee byron‘s mesh library for the 2D voronoi mesh generation and loaded it up my framework to generate a 3D heightmap mesh.   I’ve reduced the effect to almost zero here, just because i think it looks much better flat in this particular scene.

Done using processing + java.





“-0º”

NNY, a good friend and co-worker, has just released his new album, “-0º“.
The album is now available for you to listen and purchase at http://broqn.bandcamp.com





Text render for java/processing using opengl

I found out a nice way to write text in Processing with java+opengl.  It easily renders 2d and 3d text. It should be also easy to draw billboard text in 3d space. Here is the source code and an example on how to use it in processing:


import java.text.*;
import com.sun.opengl.util.*;
import com.sun.opengl.util.j2d.*;

class VTextRenderer
{
VTextRenderer( String fontName, int size )
{
_fontName = fontName;
_fontSize = size;
_textRender = new TextRenderer( new Font(fontName, Font.TRUETYPE_FONT, size), true, true, null, true );
_textRender.setColor( 1.0f, 1.0, 1.0, 1.0 );
//_textRender.setUseVertexArrays( true );
}

VTextRenderer( String fontName, int size, boolean antialiased, boolean mipmap )
{
_fontName = fontName;
_fontSize = size;
_textRender = new TextRenderer( new Font(fontName, Font.TRUETYPE_FONT, size), antialiased, true, null, mipmap );
_textRender.setColor( 1.0f, 1.0, 1.0, 1.0 );
//_textRender.setUseVertexArrays( true );
}

void print( String str, int x, int y )
{
_textRender.beginRendering( width, height, true );
_textRender.draw( str, x, y );
_textRender.endRendering();
_textRender.flush();
}

void print( String str, float x, float y, float z )
{
print( str, x, y, z, 1.0f );
}

void print( String str, float x, float y, float z, float s )
{
_textRender.begin3DRendering();
_textRender.draw3D( str, x, y, z, s );
_textRender.end3DRendering();
_textRender.flush();
}

void setColor( float c )
{
setColor( c, c, c, 1 );
}

void setColor( float c, float a )
{
setColor( c, c, c, a );
}

void setColor( float r, float g, float b )
{
setColor( r, g, b, 1 );
}

void setColor( float r, float g, float b, float a )
{
_textRender.setColor( r, g, b, a );
}

void setSmoothing( boolean flag )
{
_textRender.setSmoothing( flag );
}

/// ____________________________________________________
/// Members
int _w, _h;

String _fontName;
int _fontSize;
TextRenderer _textRender;
Font font;
}


import processing.opengl.*;

int WIDTH = 800;
int HEIGHT = 600;
float aspectRatio = WIDTH/(float)HEIGHT;

VTextRenderer textRender;

///___________________________________________________________
void setup()
{
size( WIDTH, HEIGHT, OPENGL );
hint( ENABLE_OPENGL_4X_SMOOTH );
frameRate( 60 );

//  logger = new VLog( this, “log.txt” );

aspectRatio = width/(float)height;

//textRender = new VTextRenderer( “Arial”, 100 );
textRender = new VTextRenderer( “Arial”, 100, true, true );
}

///___________________________________________________________
void draw()
{
// Write in 2d
background( 0 );
textRender.print( “vitamin”, 0, 100 );

// Write in 3d
perspective( PI*0.25,  aspectRatio, 1, 1000 );
camera( 0, 0, 100, 0, 0, 0, 0, 1, 0 );
scale( 1, -1, 1 );  // oh well. processing likes the upside down way, i dont know why.
((PGraphicsOpenGL)g).beginGL();
textRender.print( “vitamin”, 0, 0, sin(millis()*0.001)*100, 1/10.0 );
((PGraphicsOpenGL)g).endGL();
}

///___________________________________________________________
void stop()
{
super.stop();
}





,