V

Avatar



Sunflower source code

After releasing Deep’s source code, i thought to myself i could also release an old production of mine, Sunflower.
Sunflower is a visual non-interactive application a.k.a. demo, feat. music from Four Tet.

sunflower_screen

Watch Sunflower

Download source code

Hope you enjoy it





Deep Source Code

Deep is a demo created by me and Filipe “ps” Cruz. Following it’s subtle success and a few requests, i thought it would be useful to make it’s source code public. Hope you enjoy it, and make sure you watch the demo.

deep

Watch Deep

Download source code

It should be easy to get it rolling, but if you get problems, read the “readme.txt” file and make sure you have installed the dependencies. Once that is done, open the project and run it. Don’t forget to let me know if you liked it. Have fun.





Old processing stuff

Didnt want to forget about some of the the old shit i’ve done using processing, so i thought i should post it here.  Audio-reactive Landscapes, 3D Tunnels, Cel-Shading, SineWave Additive, 3D Planes, and more..

More info + source: http://www.pixelnerve.com/p5/





Ribbonmesh

This is a class i’ve made to render ribbons in 2d (planes) and in 3d (cilinders). It’s based in my framework and processing, so you might need some work to get it to compile. No example, no executable, just source code.

get class here





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();
}