sin movement

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 03 March 2006   #1
sin movement

im trying to make an object move in a sin wave (in z up down) when you move it in a direction (y for example) with wire parameters.

i tried connecting them with:

x_postion*sin(80) but it moved i a straight line. i cant figures out what i do wrong

sry for my noobness
Yeah right! sure...
Old 03 March 2006   #2
You need to also adjust the y or z position. Here is a basic sine wave example:

wave_amplitude = 60
wave_width = 10
x_position = 0

for i = 1 to 360 do (
y_position = sin(x_position) * amplitude
x_position += wave_width -- or time, whatever
obj.pos.y = y_position
obj.pos.x = x_position

I'm sure there might be more simple examples, but this is just off the top of my head.
Jason Hayes
Technical Artist
Old 03 March 2006   #3
it says:

imcompatible types: 0,0 and undifined

tnx for the help and im gonna study the expressions tuts, cos im kinda new to the whole scripting thing. But i think i have to learn it, cos it helps animating things faster.
Yeah right! sure...
Old 03 March 2006   #4
hvanzon i got it to work the way it was suggested in your other thread, the cube sat on it's corner when at 45°, and on it's side when at 90°, but inbetween it didn't work out right, it didn't really stick to the floor when close to 45

it may be i did something wrong but my guess is the the sin stuff may not be enough
Kai Stavginski

"There's nothing to it but to do it!"
Old 03 March 2006   #5
Aeron your absolutely right. It isnt a sin, cos or whatever.

i made the movement and it comes to this. Is this doable or is it real hard?
Yeah right! sure...
Old 03 March 2006   #6
btw your Dependency Graph Beta is really cool.
Yeah right! sure...
Old 03 March 2006   #7
thanks man, most of the work is really done by kees' amazing helium plugin, it's just fun scripting on top of that thing, i hope i'll find the time to work some more on this soon

as for this rolling cube thing, actually if you look at it it sure is a circular movement (the path is a quarter of a circle, so coming up with an acurate formula for this should definitely be possible (for someone who know's how to come up with formula's)
Kai Stavginski

"There's nothing to it but to do it!"
Old 03 March 2006   #8
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

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
Society of Digital Artists

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

All times are GMT. The time now is 12:01 AM.

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