[Closed] 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
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.
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.
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
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?
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)