Displacement based on an expression?
1 Attachment(s)
Does anyone know if it's possible to use an expression to control a displacement? Basically I'm trying to create a sine wave displacement, but I cannot use the Sine or Wave deformers because the displacment has to wrap around a sphere and those deformers only work linearly.
I started doing a displacment based on a ramp and got something that looks like the image below. Notice though that my waves are a bit too linear, and not round enough. So I thought I'd write a sine wave, but I can't seem to get it to work. My expression was int $height = 10 int $freq = 4; multiplyDivide1.input1Y = $height * sin( $freq * time ); While the object over time does move in a sine wave like function, it did not create waves like what I want. Anyone have any thoughts on this one? |
Did I stump you all?
|
why dont you vary the frequency and the height variables (using noise or whatever) to adjust the linearity of the waves...? seems the most logical thing to do.... :)
|
not sure I understand what you're saying?
|
use some sort of a varying value to adjust the height of the waves so that you dont end up with all the waves at the same height. Isn't that what you wanted to do?
|
1 Attachment(s)
Quote:
I got an idea. Basically I'm using the place2dTexture to drive the sine function. I create 2 ramp texture, one is for the sine and the other one for envelope. sine_ramp: only a single entry, color white. Expression is hooked up in alphaGain. Expression is: Quote:
envelope_ramp: 3 entry, loc 0, 0.5, 1.0 : color black, white, black : interpolation smooth. Outalpha from sine_ramp is mapped to alphaGain of envelope_ramp. The usage of this envelope is to do ease in and ease out of sine_ramp. Outalpha from this envelope_ramp is mapped to displacement of displacementShader, and as usual displacement from displacementShader is connected to the ShadingGroup displacement. Create a simple NURBS plane (3 x 3) and apply the shader to it. Render it and see whether you like it or not. You could adjust the color value in envelope_ramp to reduce the amplitude. For animation, I think you need to tweak a bit the expression to introduce "time" back in expression. Maybe if you do Quote:
This is just an idea, I don't know how it will work in your case. |
Actually if you don't need an exact sine function you could do also using simple ramp for the sine with 3 entry black, white, black and set interpolation to smooth.
On the 2d placement, set V repeat to 5. The rest could be the same, maybe you want to add more entry to the envelope so it has some variance to the envelope value maybe a U and V wave will have some interesting effect too. Maybe I'm too lazy to setup ramp with so many entries, that's why I'm so useless. |
All times are GMT. The time now is 01:13 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018