-
Question for Sin, Cos, Tan Experts. (pictures)
Hi,
Is there someone expert in sine, cosine, tangent that can figure out equations for the cool movements below? Or other movements also... I'm looking forward to experiment with particles and graphics, but I suck at trigonometry. I can help with graphics, experimentations and ideas. I'm sure it is pretty much possible to make great particle effects in MMF2 without extensions and seems like there is many users that would benefit from this. With HWA in beta stage, the doors for massive particle amounts are opened :)
If you want to cooperate please let me know. These screenshots below are from Xparticle, an open source particle engine for pascal/delphi.
http://img301.imageshack.us/img301/4712/ex5ay4.jpg
http://img527.imageshack.us/img527/6970/ex6ep2.jpg
http://img519.imageshack.us/img519/5180/ex1buz9.jpg
http://img247.imageshack.us/img247/6109/ex3vs6.jpg
http://img160.imageshack.us/img160/3261/ex4tq7.jpg
Thanks
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
it's VERY simple.
sin works as follows.
basically provide a value between 0-359 and times it by a your material scale.
as long as you keep your lowest value 0/359 and your highest value 180 everything will look nice,
as for cos it basically offsets your value before processing it in sin, so is nothing new.
and you will probably never need tangent in mmf as you can draw on all the values in play anyway.
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
Well, for the fourth image, I'd create an Active object, and give it the following alterble values:
Value A - Angle
Value B - XPos
Value C - YPos
Value D - Velocity
Start of frame:
Set Active_Object(XPos) to Framewidth /2
Set Active_Object(YPos) to Frameheight /2
Always:
Active_Object(Angle) add 3
Active_Object(Velocity) add 1
Set Active_Object(XPos) to Active_Object(XPos) + Cos(Active_Object(Angle)) * Active_Object(Velocity)
Set Active_Object(YPos) to Active_Object(YPos) + Sin(Active_Object(Angle)) * Active_Object(Velocity)
Set Active_Object(X Position) to Active_Object(XPos)
Set Active_Object(Y Position) to Active_Object(YPos)
Create Active_Object(-50,-50)
I think that should work, although it might need some adjusting if it's a bit slow, or fast.
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
Thanks guys,.. I posted my current 'library' of particles here:
http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=81258#Post81258
I also posted a link to a video I uploaded showing these effects.
SEELE: Thanks.. this is hard for me to understand because I had a weak background in math. Anything higher than Bhaskara formula for me is advanced LOL. I've played with tangent in some equations and got pretty fancy results.. I'll see post it soon in the file archive so you can take a look and maybe give some suggestions how to make it looks even fancier :)
izac: This is just for spiral movement or make it spread in all directions? Please watch the video to see what I mean.
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
"Thanks.. this is hard for me to understand because I had a weak background in math."
No excuse, I'm number dyslexic (discalculia), yet I wrote this:
http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=67082#Post67082
Basically, it's how to use Sin and Cos, all illustrated to show what they do. :)
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
Here are some simple trig effects I just made. They are not in any way as cool as the ones in the pictures (and video) though..
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
http://www.create-games.com/project.asp?view=news&id=1046&fid=178
Some I made with trig a while back.
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
Quote:
Originally Posted by Popcorn
Here are some simple trig effects I just made. They are not in any way as cool as the ones in the pictures (and video) though..
Woah, don't be so modest, those are very impressive and surprisingly simple. Great work on those. The cool thing is that they run smoothly in HWA even with 5000+ objects.
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
The main thing you'll want to look into is Polar Coordinates. Generally you get those funky "round" shapes by converting polar coordinates (of form (R,Θ)) to cartesian (of form (X,Y)).
You do this through the equation:
X = R * Cos(Θ)
Y = R * Sin(Θ)
To understands the more important facets to it, try reading some of the wikipedia article: http://en.wikipedia.org/wiki/Polar_coordinates
Cartesian tends to produce square or rectangular systems, while polar produces circular or ellipsal systems.
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
Dines: Lol shame on me :P I remember a very very old example of Andrew Mather showing orbit examples with paste into background, that created pretty shapes, all using sine and cosine. Very cool.
Popcorn: Thanks man... I'll see if I can make something cool with particles using your file :)
Pixelthief: Thanks for the info.. I'll definitely take time to study this!
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
also note in MMF, angle [zero] faces directly down; 180 up, 270 left and 90 = right.
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
OOOww, you know, i gave up on a virtual host a while back because it always spat out an 90 offset value and it was mmf's fault the whole time hehe, i guess i might finish it then. ;)
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
Thanks for all your attention. I need a little help in two particle effects that I'm working on, that should be updated in the particle effects thread at the file archive.
How to assign a directional force (like gravity)to the expression
Value_B( "particle" )+(Cos(Value_A( "particle" )*-1.0)*Value_E( "particle" ))
and
Value_C( "particle" )+(Sin(Value_A( "particle" )*-1.0)*Value_E( "particle" ))
of example "Simple Spread"? (it's located in this example here:http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=81531&fpart=1 in the particlelibrary2.zip only)
The other help is, I have an ellipse movement, let's say earth and sun, represented in the expression below.
Always set
X pos to --> (Sin(Global Value A)*50)+X( "sun" )
Y pos to --->(Cos(Global Value A)*100)+Y( "sun" )
in the expression above how do I "tilt" this movement? see image below for visual representation
http://img155.imageshack.us/img155/5539/tiltod1.jpg
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
for the diagonal one, set x to 'xpole+((0.5+(cos*0.5))* distance to rigthx pole) and similarly the other.
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
thanks SEELE, just to make sure, this formula works with any angle or just 45 degrees? And what should be the difference between the Xpole to the distance to the right Xpole'? I assume the "xpole" you mention is the value that determinates how far the the ball orbits in the X axis? (from one pole to another)
-
Re: Question for Sin, Cos, Tan Experts. (pictures)
YES!, and you would need to change the formula a little:
set x to 'xpole+((g+(cos*j))* distance to rigthx pole)
set y to 'ypole+((g+(sin*j))* distance to bottomy pole)
The 'g' represents the left pole offset and the 'j' represents the right pole offset, so a full circle would be g=0 j=1 & 45 degree on the left axis would be g=0 & j=0.5 and that works for everything inbetween.
Good Luck.
ow and the distance basicly represents the size of the circle so if your circle is 16*16 then your 'distance to rigthx pole' is 16.