Skip to content

Instantly share code, notes, and snippets.

@tado
Created October 5, 2013 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tado/6846720 to your computer and use it in GitHub Desktop.
Save tado/6846720 to your computer and use it in GitHub Desktop.
#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