Physics: trajectory, axis, lever

Started by rbaleksandar, Thu 05/02/2009 19:38:11

Previous topic - Next topic

Khris

#20
It doesn't matter whether you begin with a positive or negative y. Why would a ball fly differently if you moved the point of origin...?

Remember that a computer screen's origin is at the top-left, not bottom left.
Thus I start with a negative y acceleration, to represent movement directed upwards. Gravity points downwards, i.e. is a positive acceleration; this is reflected by adding 0.1 to the y movement every game loop (leading to the y movement's magnitude getting smaller, zero, then bigger again).

Long story short: I had working code producing a nice trajectory using very similar values.

beomoud

just start trying any of these solutions and we're here if you need anything

rbaleksandar

Thank you so much for all the explanations. I'll need lots of time for what I want to do... But I hope at the end it'll be a well done work ;)
I am a mighty pirate. Arrrrgh!

Wonkyth

Quote from: KhrisMUC on Tue 10/02/2009 10:44:29
Remember that a computer screen's origin is at the top-left, not bottom left.

This has always confused me. ???
"But with a ninja on your face, you live longer!"

rbaleksandar

Actually I didn't know that...Well, I've mostly programmed in Java and there when you use Swing for example it's the same...Good to know that it's the same here ;)
I am a mighty pirate. Arrrrgh!

Khris

I'm pretty sure that every language that supports graphic commands has their origin at the top-left.
This convention is as old as computers and stems from everything being text-based where the top-most line is naturally the first one.

If it's that confusing, there's always the possibility to have the origin at the bottom left in your calculations, then do y=Screen.Height-1-y at the drawing stage.

rbaleksandar

:) Thanks again :) btw You're right about this convention...But never thought of it being included in AGS :)
I am a mighty pirate. Arrrrgh!

SMF spam blocked by CleanTalk