Created
October 5, 2013 22:18
-
-
Save tado/6846720 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "testApp.h" | |
//-------------------------------------------------------------- | |
void testApp::setup(){ | |
ofBackground(63); | |
light.setup(); | |
light.setPosition(ofGetWidth()/2 - 100, ofGetHeight()/2 - 100, 400); | |
} | |
//-------------------------------------------------------------- | |
void testApp::update(){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::draw(){ | |
// sphere animation | |
ofPushStyle(); | |
ofEnableDepthTest(); | |
ofEnableLighting(); | |
light.enable(); | |
ofSetHexColor(0xcccccc); | |
ofSpherePrimitive sphere; | |
sphere.setRadius(sin(ofGetElapsedTimef() * 4.0) * 100 + 200); | |
sphere.setResolution(mouseX / 2.0); | |
sphere.setPosition(ofGetWidth()/2, ofGetHeight()/2, 0); | |
sphere.drawWireframe(); | |
ofDisableLighting(); | |
ofDisableDepthTest(); | |
ofPopStyle(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment