Created
November 6, 2018 20:50
-
-
Save cyrstem/15835728aae9d2bc3fa26ec35cbfc159 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// setup lights | |
ofSetSmoothLighting(true); // nicer lighting rendering | |
// setup point light | |
light.setPointLight(); | |
light.setPosition(0, 0, 200); | |
light.setDiffuseColor( ofColor::white ); | |
light.setAttenuation(.5); // adjust the light throw | |
// setup spot light | |
spotlight.setSpotlight(); | |
spotlight.setPosition(300, 0, 0); | |
spotlight.lookAt(sphere); | |
spotlight.setDiffuseColor( ofColor::blue ); | |
light.setSpecularColor( ofColor::fuchsia ); | |
draw() | |
ofEnableLighting(); // turn on lighting globally | |
ofEnableDepthTest(); // render objects in order of depth | |
light.enable(); // enable our lights | |
spotlight.enable(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment