Fun with sin and cos
-
We wuz messing about with security cameras, trying to make them a bit more interesting than Click!...pan left; Click! pan right.
James had the idea of introducing a sin or cos function into an animatecustom routine.
The attached is a very rough and ready development from....animatecustom("Rotz",10,0,0,0,90)...which simply rotated through 90 degrees over 10 seconds.
The attached file will oscillate back and forth continuously for 2 minutes; so basically the 120 (in the onClick) is the length of the animation, the 7200 is the number of degrees it has to get through in that time, hence its speed.
-
Thats a great camera Alan! I really need to invest some time into figuring out how to use sin and cosin and all ther trig functions. I never did this in school, and its finally catching up to me
Chris
-
I reckon it would be well worth your while working out some basic trig, it should be very handy for your DCs. I'd also have a look at trig identities and things, they can save you code and calculations, one of my formulas got a lot nicer when I remembered that the thing was inclined at 30 degrees, so the length was just twice the rise (sin30 = 0.5). Plenty of universities will have notes on the web for basic trig courses, so you should be ok.
Technically, it should be possible to model any path using sin and cos, but my Fourier analysis is very rusty and I really don't want to have to type it all into that little box. I think it should be possible to use something like the example above to script more complex movement, though. I wasn't entirely sure if it would work, but I was glad it did.
-
ok, so I found a fun one. I'm sjut plugging in numbers to see what I get, and I like this one! Its a box that bounces up and down and back and forth.
Help save the box! Get it safely from one side of the chasm to the other, by clicking on it.
Chris
-
Brilliant!
-
Swinging under camera
PS With the "Free"
Have you seen that you can make start many boxes in
the same time
Just click on the right over top box! -
Any chance with the "free" to copy a comportment of a Dynamic component to another object group?
Or "past" a group on a Dynamic component? -
Tbere is a security camera and a flipping coin on the 3dwh that use some pretty cool trig stuff. If you haven't seen that security camera, maybe it would be better not to and compare the Attributes. I have been really surprised how different people are accomplishing similar things with DCs.
-
This thread is what got me thinking about how to animate a ping pong ball that lead to a DC movie I made o Bryce and Sang playing Ping Pong:
http://www.sketchucation.com/forums/scf/viewtopic.php?f=289&t=14871
Indeed there is a lot of power with figuring out how to control this better and seeing how other people are accomplishing similar tasks.
Chris
Advertisement