Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Diffuse driven by object rotation; but for a whole army.
PostPosted: Fri Jan 13, 2012 10:40 pm 
User avatar
Jedi Master
Offline

Joined: Wed Apr 02, 2008 11:16 pm

Posts: 1007

Location: Kapiti Coast, Wellington
I recently showed someone how to link a procedural texture (diffuse) into the Rotation-Y property of their model so that when they rotated the model, the colour woud automatically change. This was good but it wasn't just one model they wanted; they wanted a whole array. Specifically, they pointed me to the following YouTube video showing a lot of arrows moving at different times:



Now - I know I can make one arrow so that when it points vertically it goes red, but when it points horizontally, it turns blue. But I'm not sure on the approach I should take to make this work with an army of arrows. If I use a global procedural material then when one arrow changes from red through to blue, the others would also given that they link to the same material.

Can someone please point me in the direction as to how they would approach this? I use Blender, though I don't mind general theory or approaches used in other 3D applications.

The original thread where someone asked about this is here: http://blenderartists.org/forum/showthread.php?242326-Change-color-mid-animation where I have also uploaded a Blender file of one arrow working. (My iPad didn't show their video so I originally missed that they wanted lots of objects instead of just one)


Top
 Profile  
 
 Post subject: Re: Diffuse driven by object rotation; but for a whole army.
PostPosted: Sat Jan 14, 2012 12:06 am 
User avatar
Moderator
Offline

Joined: Sun Feb 17, 2008 10:20 pm

Posts: 1339

Location: Wellington, NZ
Any reason you want to do it with a texture and not with particle attraction/dynamics?

_________________
A bus station is where a bus stops. A train station is where a train stops. On my desk I have a workstation.


Top
 Profile  
 
 Post subject: Re: Diffuse driven by object rotation; but for a whole army.
PostPosted: Sat Jan 14, 2012 8:23 am 
User avatar
Jedi Master
Offline

Joined: Wed Apr 02, 2008 11:16 pm

Posts: 1007

Location: Kapiti Coast, Wellington
It's not the above examples where the question lies.The person who's originally asked this wants to do the same, but have the arrows change colour while they move. For example, an arrow pointing upright would be red whereas if it lies down, then it would be blue. I did the driver rotation - to colour thing through simple linking of diffuse colour through python to a graph changing the colour. It works but affects the global material shader all objects are using.

...hmm - you're making me think further though. Y'reckon particles might have their own individual colour property I might manipulate? Possibilities...


Top
 Profile  
 
 Post subject: Re: Diffuse driven by object rotation; but for a whole army.
PostPosted: Sat Jan 14, 2012 11:11 am 
User avatar
Moderator
Offline

Joined: Sun Feb 17, 2008 10:20 pm

Posts: 1339

Location: Wellington, NZ
Ah, so it's just the colour change you're worried about? The easiest (and probably messiest) way I can think of is to have a separate shader for each object and write an expression telling the colour channel to change based on the combination of the X and Z rotations (if Y is up). Of course that would mean a LOT of copy/pasting... There may be a way of having a node in between the material and object nodes that alters the output of the material before it gets to the object? If that makes sense? Kind of like a multiply/divide node (in Maya).

I know there's 'per particle' properties you can manipulate in Maya including colour, and you may be able to link that to the material and per object, but the more I think about it the more I realise there's a lot more thinking to be done... lol.

_________________
A bus station is where a bus stops. A train station is where a train stops. On my desk I have a workstation.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

About Us


Contact Us


Advertise on NZCGI

Powered by phpBB® Forum Software © phpBB Group
Logo Design by - Oliver Hilbert Revilo Designs