mjs1
11-05-2005, 05:23 AM
I'd like to have a function that places a specular highlight via a mouse click on an object. The way it would work is that you select a light, then, viewing through the render camera, click on a selected object. The ray from the viewpoint to the surface point is calculated and reflected about the surface normal at that popint. The light is then placed along the reflected ray.
Does anyone have a script that already does that? If not, are there some MEL functions out there that can:
1. Convert mouse-selected screen coordinates to a 3D world space position on an object
2. Construct a ray from the camera to that point.
3. Get the surface normal for the point found on the surface
4. Reflect the incident camera ray around that normal
5. Align the spotlight position and aim vector along this reflected ray.
Thanks!
Does anyone have a script that already does that? If not, are there some MEL functions out there that can:
1. Convert mouse-selected screen coordinates to a 3D world space position on an object
2. Construct a ray from the camera to that point.
3. Get the surface normal for the point found on the surface
4. Reflect the incident camera ray around that normal
5. Align the spotlight position and aim vector along this reflected ray.
Thanks!
