Page 2 of 3

Re: Pointing an image

Posted: Mon Apr 18, 2011 6:31 am
by Jasoco
Taehl wrote:You mean, math.pi*.5, right? Rotating by 90 radians would be like rotating by 5156 degrees...
Sorry, I think in degrees. So I usually convert my degree numbers to radians. Yes, 90 degrees would be half pi. 180 would be pi. And 270 would be pi and a half. 360 would be 0 or two pi... mmm... I wish I had 2 pi's...

Re: Pointing an image

Posted: Mon Apr 18, 2011 6:55 am
by BlackBulletIV
I'd recommend Tau for radians instead of Pi.

Code: Select all

math.tau = math.pi * 2
math.tau -- 360 or 0 deg
math.tau / 2 -- 180
math.tau / 4 -- 90
math.tau / 8 -- 45
-- and so on...
It's easy to remember because if you replace math.tau with 1 in your head, that's the fraction of a circle you get.

Re: Pointing an image

Posted: Mon Apr 18, 2011 7:04 am
by Robin
BlackBulletIV wrote:I'd recommend Tau for radians instead of Pi.
I knew you'd say that when I read Jasoco's post. :P

Re: Pointing an image

Posted: Mon Apr 18, 2011 7:06 am
by Jasoco
I still prefer to use degrees.

Re: Pointing an image

Posted: Mon Apr 18, 2011 7:29 am
by BlackBulletIV
Robin wrote:
BlackBulletIV wrote:I'd recommend Tau for radians instead of Pi.
I knew you'd say that when I read Jasoco's post. :P
Ha ha, but what's wrong with Tau? It's better than Pi (and hey, you get twice as much pie too! :P).

Re: Pointing an image

Posted: Mon Apr 18, 2011 7:36 am
by Taehl
I prefer pi (that is to say, radians) to tau, degrees, quaternions, or anything else.

Re: Pointing an image

Posted: Mon Apr 18, 2011 8:39 am
by BlackBulletIV
Why's that? I'm interested to know. How is \( \frac{\pi}{2} \) to make a quater circle more logical than \( \frac{\tau}{4} \)?

Re: Pointing an image

Posted: Mon Apr 18, 2011 12:06 pm
by Anxiety
And yet again, more problems. Now the characters face isnt looking at the mouse, but the characters top left corner is.

And just for you to see it, heres the .love file.

Re: Pointing an image

Posted: Mon Apr 18, 2011 1:17 pm
by Anxiety
I got it working by using the love.graphics.draw function's offset x and offset y.

Thanks guys!

Re: Pointing an image

Posted: Mon Apr 18, 2011 1:25 pm
by BarnD
Anxiety wrote:I got it working by using the love.graphics.draw function's offset x and offset y.
I was just about to say that, but then you edited the post. :)
Cause im making a game, which is so far basically like yours, and I did that too.