CGTalk > Software > Autodesk Maya > Maya Dynamics
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 04-14-2008, 07:32 AM   #1
triptych79
Veteran
Joe
Brisbane, Australia
 
Join Date: Apr 2008
Posts: 41
Sprite Scale driven by image

Hi,

I have sprites being emitted from a plane. The emission is being controlled with a gray scale image. I was wanting to drive the scale the of emitted sprites with the colour of the image (ie. the lighter the colour, the smaller the sprite). How would I go about doing this?

Thanks,
trip
 
Old 04-14-2008, 08:08 AM   #2
Aikiman
Pixel Collisions
 
Aikiman's Avatar
portfolio
Jeremy Raven
Wellington, New Zealand
 
Join Date: Jun 2005
Posts: 3,582
At a guess use colorAtPoint command to reference the texture where the particle is born which will give you rgb values. Then perhaps wrap that in a mag function so you get a single float value which you then apply to your scale X and Y.
__________________
www.jeremyraven.co.nz
Vimeo
 
Old 04-14-2008, 08:36 AM   #3
phildog
FX & Lighting
 
phildog's Avatar
Phil
FX, writer, director, editor
philwittmer.com
sydney, Australia
 
Join Date: Apr 2003
Posts: 124
did you know you can emit into rgbPP using the same texture?
just add the same texture to the emit color slider of the emitter
then add an rgbPP attribute to the particles.

you dont have to use this rgbPP to render (infact sprites ignore it) but you can use
the value to do a mag() like Jeremy said before

Quote:
Originally Posted by triptych79
Hi,

I have sprites being emitted from a plane. The emission is being controlled with a gray scale image. I was wanting to drive the scale the of emitted sprites with the colour of the image (ie. the lighter the colour, the smaller the sprite). How would I go about doing this?

Thanks,
trip
__________________
www.philwittmer.com
sydney wedding videos
production, design, Fx and post production
 
Old 04-14-2008, 12:52 PM   #4
triptych79
Veteran
Joe
Brisbane, Australia
 
Join Date: Apr 2008
Posts: 41
Thanks

Thanks to both of you for your help. It worked a treat - I tried Phil's method first up as it seemed the easiest. No doubt the other approach would have worked too.

I had another question which I don't necessarily want to do, but 'thought' of doing. Instead of inverting the image and the 'Emit from Dark' to basically invert the scale of the sprites, is there a way, using expressions, to set a new range for the values outputted by the rgbPP? For example, just say I wanted to make dark values of the image emit the scale that a lighter value would and vice versa.

I know it could be done as I had mentioned with the texture before, but is there a way or a particular function that allows it to be done with expressions?

Thanks again.
 
Old 04-14-2008, 10:00 PM   #5
Aikiman
Pixel Collisions
 
Aikiman's Avatar
portfolio
Jeremy Raven
Wellington, New Zealand
 
Join Date: Jun 2005
Posts: 3,582
Phils the expert but Im keen to have a stab. From my understanding if you subtract a linstep function from 1 yet get the reverse happening. So by using your min/max values from the mag function and using the 1 - linstep, you can reverse your values that way and apply that to your scale X and Y.
__________________
www.jeremyraven.co.nz
Vimeo
 
Old 04-15-2008, 12:25 AM   #6
triptych79
Veteran
Joe
Brisbane, Australia
 
Join Date: Apr 2008
Posts: 41
Nice one

Hey Jeremy

Thanks for the reply. It worked!

Cheers,

trip

Last edited by triptych79 : 04-15-2008 at 03:58 AM.
 
Old 04-15-2008, 12:25 AM   #7
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 02:41 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.