Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Crash on ofLight setPosition

$
0
0

@jag wrote:

Hi there, I'm a bit confused about what's happening here. My ofApp.h has a declaration of an ofPrimitivePlane like this

public:
void setup();
void update();
void draw();
.
.
.
ofLight light;
ofShader shader;
ofPlanePrimitive plane;
vector<ofBoxPrimitive> boxes;

And my ofApp.cpp has a setup function like this:

void ofApp::setup(){

//    ofSetVerticalSync(true);

ofSetFrameRate(60);
ofBackground(0, 0, 0);
ofEnableDepthTest();
ofEnableLighting();

light.setPosition(-700, 0, 0);

light.setSpecularColor(ofColor(255.f, 255.f, 255.f));
light.setDiffuseColor( ofColor(255.f, 255.f, 255.f));
light.setSpotlight();
ofSetSmoothLighting(true);
lightColor.setBrightness( 180.f );
lightColor.setSaturation( 150.f );
lightColor.setBrightness(255);
lightColor.setSaturation(255);

The weird thing is if I comment out the declaration of the ofPrimitivePlane in the .h file, I get a crash on setup(); specifically Xcode tells me that it's crashing at ofNode::setPosition (the call on light).

Does anyone know why setup is crashing here when I'm just removing an ofPrimitivePlane declaration? If it's not something obvious I'll have to dig further.

Thanks!

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles