Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Texturing based on camera direction (https://simplymaya.com/forum/showthread.php?t=11349)

carrot juice 08-04-2004 09:54 PM

Texturing based on camera direction
 
Does anyone know how to write a script that would planar projection map all the faces of a model visible to the camera along the direction that the camera is facing (with all the default planar projection attrs)?

I'm planning to use this in conjunction with "use frame extension" and a sketched-looking outline (tomcat) in order to acheive a hand-drawn effect. This script (if it's possible) would create painterly shading that has different texture and strokes each frame because of the 'use frame extension' images, and scales with the closeness of the camera. (if it just did a planar projection on all the faces instead of only those visible to the camera, the strokes in the image would seem to get bigger as the camera moved closer).

Thanks!

Alan 12-04-2004 01:33 PM

ok this might help.

Create your camera and your model I used a tours just as a test. THen apply a planar projection to it.

Now in the channel box right click the projection centre X box and create an expression. set it to:

polyPlanarProj1.projectionCenterX = camera1.translateX;
polyPlanarProj1.projectionCenterY = camera1.translateY;
polyPlanarProj1.projectionCenterZ = camera1.translateZ;

replace the camera name and the projection names with yours. Now apply a texture to it and move the camera, you should see the texture moving based on where the camera is.

Hope that is some help

Alan

carrot juice 12-04-2004 07:49 PM

that's exactly what I needed! thanks so much.

Kurt 12-04-2004 07:53 PM

Danny has a script on his website that i use all time its great...

carrot juice 12-04-2004 09:07 PM

I'm having a bit of a problem- in the channel box there aren't any options for the projection. I must be missing something...

Thanks

EDIT: It worked when I selected all the faces of the model and used the planar projection command on the polys shelf. hmm. before I was selecting edit polygons--->texture--->planar projection. Hrm.

Alan 13-04-2004 08:18 AM

it creates a node underneath the shape node of the object that's where the channels are.

Alan

hkal 14-04-2004 06:57 AM

that's exactly what I needed! thanks so much.


All times are GMT. The time now is 03:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018