SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / Texturing based on camera direction
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 08-04-2004, 09:54 PM   #1
carrot juice
Registered User
 
carrot juice's Avatar
 
Join Date: Mar 2003
Location: San Antonio, TX
Posts: 346
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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!
carrot juice is offline   Reply With Quote
Old 12-04-2004, 01:33 PM   #2
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

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
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
Old 12-04-2004, 07:49 PM   #3
carrot juice
Registered User
 
carrot juice's Avatar
 
Join Date: Mar 2003
Location: San Antonio, TX
Posts: 346
Thanks: 0
Thanked 0 Times in 0 Posts
Default

that's exactly what I needed! thanks so much.
carrot juice is offline   Reply With Quote
Old 12-04-2004, 07:53 PM   #4
Kurt
Registered User
 
Kurt's Avatar
 
Join Date: May 2002
Location: Niagara Falls, Canada
Posts: 5,298
Thanks: 0
Thanked 64 Times in 64 Posts
Default

Danny has a script on his website that i use all time its great...
__________________
I am enough of an artist to draw freely upon my imagination, knowledge is limited, imagination encircles the world. (Albert Einstein)

http://kurtboutilier.cgsociety.org/
Kurt is offline   Reply With Quote
Old 12-04-2004, 09:07 PM   #5
carrot juice
Registered User
 
carrot juice's Avatar
 
Join Date: Mar 2003
Location: San Antonio, TX
Posts: 346
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

Last edited by carrot juice : 12-04-2004 at 09:27 PM.
carrot juice is offline   Reply With Quote
Old 13-04-2004, 08:18 AM   #6
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

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

Alan
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
Old 14-04-2004, 06:57 AM   #7
hkal
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

that's exactly what I needed! thanks so much.
hkal is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.