Integrating 3D models with photography

Interested in integrating your 3D work with the real world? This might help

#
**1**
* *
08-10-2012
, 04:07 PM

Subscriber

Join Date: Oct 2005

Join Date: Oct 2005

Posts: 1

Have a creation expression of: particleShape1.RandRotate = <<0,0,rand(-3,3)>>; because I want the planes to be created with a rotation, randomly, between -3 and 3. Again simple enough, but now where the problem comes in, I need them to twist smoothly and randomly between -3 and 3 during runtime.

Have a runtime expression of: particleShape1.RandRotate += <<0,0,sin(time*2)*1.1>>; which works, but it does not sweep between the full positive and negative degrees. Would not make any sense to have them only rotate between 0 and 3 say haha.

Anyone have any ideas?

#
**2**
* *
06-11-2012
, 04:06 AM

You also have to remember that in Maya, sine expects units in radians, meaning that 2*pi = (~6.28) = one full cycle of sine. Therefore, in 6 frames, you make a complete cycle of sine. In your expression, you have halved that (remember that multiplying inside the brackets does the opposite transformation), so it now takes 3 frames to cycle completely. The minimums and maximums of sine are found at pi/2 and (3*pi)/2. (Green lines) Since (2*pi)/3 = ~2.1, you are jumping past pi/2, and again past (3*pi)/2. In the example where you are currently hitting are the red lines.

In short:

float $speed = 0.02;

pCube1.rotateZ = (3.0 / 2.0) * (sin(frame * (1.0 / $speed)) + 1);

Imagination is more important than knowledge.

#
**3**
* *
03-02-2013
, 05:15 PM

Code:

float $fFreq = 1.0; float $fMag = 3.0; myObject.rotateZ = $fMag * noise(time * $fFreq);

#
**4**
* *
03-02-2013
, 07:43 PM

You can do this by the following function: (3/2) * (sin(x) + 1)

You also have to remember that in Maya, sine expects units in radians, meaning that 2*pi = (~6.28) = one full cycle of sine. Therefore, in 6 frames, you make a complete cycle of sine. In your expression, you have halved that (remember that multiplying inside the brackets does the opposite transformation), so it now takes 3 frames to cycle completely. The minimums and maximums of sine are found at pi/2 and (3*pi)/2. (Green lines) Since (2*pi)/3 = ~2.1, you are jumping past pi/2, and again past (3*pi)/2. In the example where you are currently hitting are the red lines.

In short:

float $speed = 0.02;

pCube1.rotateZ = (3.0 / 2.0) * (sin(frame * (1.0 / $speed)) + 1);

trying to combine the commands shown here with a previous one about a flickering light

would you be willing to explain this a little more further....

or maybe i have to open a new thread with an explanation of my goal......???

*

The Universe is larger then you ever can think, But smaller then the size of your imagination.

all are welcome at www.ieoie.nl

Random smooth flickering
by ieoie in forum Programming replies 0 on 03-02-2013
simple expression question
by lxhtin in forum Dynamics & Special Effects replies 0 on 04-11-2012
rotation expression troubles
by bendingiscool in forum Programming replies 1 on 26-10-2007
rotate a joint in opposite axis
by daveatpressac in forum Programming replies 2 on 10-11-2003
Need help troubleshooting expression.
by NitroLiq in forum Programming replies 4 on 08-01-2003

Resident Evil - Teaser Trailer
On 2022-05-13 13:52:25

New cloud modeling nodes for Bifrost
On 2022-05-02 20:24:13

MPC Showreel 2022
On 2022-04-13 16:02:13

Unreal Engine 5 is released
On 2022-04-06 12:59:07

Minions: The Rise of Gru trailer
On 2022-04-06 12:57:02

Autodesk releases Maya 2023
On 2022-03-31 12:10:08