Commit 59537e35 authored by Dat Nguyen's avatar Dat Nguyen

Added Kevin's Trees

parent 385b7dc0
......@@ -6,6 +6,9 @@ bool shouldRemoveRigidBody( const shared_ptr<ofxBulletRigidBody>& ab ) {
//--------------------------------------------------------------
void ofApp::setup(){
branches.setup();
ofSetVerticalSync(true);
ofSetFrameRate(60);
ofDisableArbTex();
......@@ -21,7 +24,7 @@ void ofApp::setup(){
ground.setProperties(.25, .95);
ground.add();
light.setPosition( 0, -2000, 1900 );
light.setPosition( 0, -1000, 0 );
shared_ptr< ofxBulletSphere > sphere( new ofxBulletSphere() );
sphere->create( world.world, ofVec3f(0,-10.55,0), 0., 20.0 );
......@@ -141,14 +144,55 @@ void ofApp::update(){
//--------------------------------------------------------------
void ofApp::draw(){
ofBackground(0);
ofEnableDepthTest();
camera.begin();
ofEnableLighting();
light.enable();
//DRAW TREE
ofPushMatrix();
ofFill();
ofSetColor(255, 255, 0);
ofTranslate(ofVec3f(100,65,100));
branches.draw();
ofPopMatrix();
ofPushMatrix();
ofFill();
ofSetColor(255, 255, 0);
ofTranslate(ofVec3f(200,65,300));
branches.draw();
ofPopMatrix();
ofPushMatrix();
ofFill();
ofSetColor(255, 255, 0);
ofTranslate(ofVec3f(-100,65,-100));
branches.draw();
ofPopMatrix();
ofPushMatrix();
ofFill();
ofSetColor(255, 255, 0);
ofTranslate(ofVec3f(-300,65,400));
branches.draw();
ofPopMatrix();
ofPushMatrix();
ofFill();
ofSetColor(255, 255, 0);
ofTranslate(ofVec3f(200,65,-300));
branches.draw();
ofPopMatrix();
ofPushMatrix();
ofFill();
ofSetColor(255, 255, 0);
ofTranslate(ofVec3f(600,65,-300));
branches.draw();
ofPopMatrix();
//ofSetColor( 255,255,255 );
//ground.draw();
......
......@@ -3,6 +3,7 @@
#include "ofMain.h"
#include "ofxFPSCamera.h"
#include "ofxBullet.h"
#include "Branch.h"
class ofApp : public ofBaseApp{
......@@ -19,6 +20,8 @@ class ofApp : public ofBaseApp{
void mouseReleased(int x, int y, int button);
void windowResized(int w, int h);
ofxFPSCamera camera;
......@@ -43,6 +46,7 @@ class ofApp : public ofBaseApp{
shared_ptr<ofxBulletTriMeshShape> bulletMesh;
float anisotropy;
ofFbo fbo, fboSphere;
Branch branches;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment