how can i set the intensity of a light?
or the radius?
further, how can i move the model instead of the camera?
Thanks in Advance
lumo
PS: ambient color makes whole set lighter...
i am testing with the settings from lights sample...
4 lights there, but only one shows up
light intensity & model
The attenuation factor of a light is controlled by sceGuLightAtt(). The normal way of computing attenuation is as follows:and this should map to sceGuLightAtt(). Using PSPGL, you use glLightfv() with GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION and GL_QUADRATIC_ATTENUATION.
As for transforming the object, if you use GUM or PSPGL, you simply store the inverse of the camera (also known as a view) as the root matrix on the view-stack, push those values on the matrix stack and then transform the object in question.
Code: Select all
attenuation = 1 / (atten0 + atten1 * distance + atten2 * (distance*d * distance))
As for transforming the object, if you use GUM or PSPGL, you simply store the inverse of the camera (also known as a view) as the root matrix on the view-stack, push those values on the matrix stack and then transform the object in question.
GE Dominator
ok will play with those values...
but this does not make any sense to me:
shouldn't create this code 4 lights?
when i compile it i only get ONE white light!
greets
lumo
but this does not make any sense to me:
Code: Select all
//color setup
unsigned int colors[4] =
{
0xffff0000,
0xff00ff00,
0xff0000ff,
0xffff00ff
};
Code: Select all
//lightning
sceGuEnable(GU_LIGHTING);
sceGuEnable(GU_LIGHT0);
sceGuEnable(GU_LIGHT1);
sceGuEnable(GU_LIGHT2);
sceGuEnable(GU_LIGHT3);
Code: Select all
// setup a light
for (int i = 0; i < 4; ++i)
{
ScePspFVector3 pos = { cosf(i*(GU_PI/2) + val * (GU_PI/180)) * LIGHT_DISTANCE, 0, sinf(i*(GU_PI/2) + val * (GU_PI/180)) * LIGHT_DISTANCE };
sceGuLight(i,GU_POINTLIGHT,GU_DIFFUSE_AND_SPECULAR,&pos);
sceGuLightColor(i,GU_DIFFUSE,colors[i]);
sceGuLightColor(i,GU_SPECULAR,0xffffffff);;
sceGuLightAtt(i,0.0f,1.0f,0.0f);
}
sceGuSpecular(12.0f);
sceGuAmbient(0x00222222);
when i compile it i only get ONE white light!
greets
lumo