Jump to content
SM

[OpenGL] Spotlight

Recommended Posts

SM

	GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat light_position[] = { ship->getX(),ship->getY(),0, 1.0 };
GLfloat spotDir[] = { 0,100,0};
glLightfv(GL_LIGHT1,GL_SPECULAR,mat_specular);
glLightfv(GL_LIGHT1,GL_POSITION,light_position);
glLightf(GL_LIGHT1,GL_SPOT_CUTOFF,90.0);
glLightf(GL_LIGHT1,GL_SPOT_EXPONENT,1.0);
glLightfv(GL_LIGHT1,GL_SPOT_DIRECTION,spotDir);

Alguem me sabe explicar nesse codigo porque e´que não se ve qualquer efeito do spotlight?

Edited by Rui Carlos
Formatação do código.

Share this post


Link to post
Share on other sites
HappyHippyHippo

tens uma superfície onde a luz seja reflectida ?

na natureza ela reflete nas particulas de pó existentes no ar, mas em ambientes computacionais, tu não vez o cone de luz, isso tem de ser modelado. só vez a luz se ela refletir de em algum objecto


IRC : sim, é algo que ainda existe >> #p@p

Share this post


Link to post
Share on other sites
SM

Ja resolvi, tinha que actualizar constantemente o valor de x e y. Porém, está a funcionar com lag, cm tirar o lag?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.