Pointing an image

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Pointing an image

Post 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...
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Pointing an image

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Pointing an image

Post 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
Help us help you: attach a .love.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Pointing an image

Post by Jasoco »

I still prefer to use degrees.
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Pointing an image

Post 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).
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Pointing an image

Post by Taehl »

I prefer pi (that is to say, radians) to tau, degrees, quaternions, or anything else.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Pointing an image

Post 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} \)?
User avatar
Anxiety
Prole
Posts: 49
Joined: Sat Apr 02, 2011 9:36 am
Location: Finland

Re: Pointing an image

Post 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.
Attachments
CharMoving.love
(1.63 KiB) Downloaded 91 times
I can't come up with a good signature!
User avatar
Anxiety
Prole
Posts: 49
Joined: Sat Apr 02, 2011 9:36 am
Location: Finland

Re: Pointing an image

Post by Anxiety »

I got it working by using the love.graphics.draw function's offset x and offset y.

Thanks guys!
I can't come up with a good signature!
User avatar
BarnD
Prole
Posts: 49
Joined: Wed Jun 16, 2010 1:23 pm
Location: Australia
Contact:

Re: Pointing an image

Post 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 82 guests