Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

878158 Posts in 32909 Topics- by 24328 Members - Latest Member: Pl4n3

May 21, 2013, 09:52:02 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)The happy programmer room
Pages: 1 ... 96 97 [98] 99 100 ... 227
Print
Author Topic: The happy programmer room  (Read 263504 times)
Glaiel-Gamer
Moderator
Level 10
******


Stoleurface!


View Profile WWW Email
« Reply #1455 on: January 20, 2011, 10:52:03 AM »

The amount of uses I've found for dot-prod over the years is amazing.

Mostly just from wanting to know if two lines are pointing the same direction.
What's wrong with atan2(x1 - x2,y1 - y2)?

the jump from -180 to 180
Logged

Fallsburg
Level 10
*****


Fear the CircleCat


View Profile WWW
« Reply #1456 on: January 20, 2011, 12:18:21 PM »

The amount of uses I've found for dot-prod over the years is amazing.

Mostly just from wanting to know if two lines are pointing the same direction.
What's wrong with atan2(x1 - x2,y1 - y2)?

the jump from -180 to 180
This.  Well, that and the fact that atan2 is always y then x.
Logged

st33d
Guest
« Reply #1457 on: January 20, 2011, 03:22:48 PM »

I'd love for you to share any effective and useful algorithms, if you're up to it.

I've got a neural net you can use: http://robotacid.com/flash/gesture/index.html

I developed it into this mini game: http://www.nitrome.com/games/magictouch

It's in your favourite language. Flash!

(okay - I ported it from Java: http://robotacid.com/PBeta/gesture/index.html - which was partly based on: http://www.generation5.org/content/2004/aiTabletOcr.asp but I think I got the BPN base code from somewhere else. But as BPNs go it's alright when you get a good training session, haven't taken a thorough look at it though, it''s a bit of a black box to me)
Logged
bateleur
Level 10
*****



View Profile
« Reply #1458 on: January 21, 2011, 12:00:18 AM »

I developed it into this mini game: http://www.nitrome.com/games/magictouch
Nice concept, but the line length limit is super annoying. Sad
Logged

st33d
Guest
« Reply #1459 on: January 21, 2011, 12:43:06 AM »

Yea, made early in my game making career. AS2 and an inexperienced programmer.

 Shrug
Logged
bateleur
Level 10
*****



View Profile
« Reply #1460 on: January 21, 2011, 01:16:15 AM »

AS2

Screamy <- flashbacks!
Logged

Skomakar'n
Level 10
*****


Vąutah


View Profile WWW Email
« Reply #1461 on: January 21, 2011, 03:38:46 AM »

The amount of uses I've found for dot-prod over the years is amazing.

Mostly just from wanting to know if two lines are pointing the same direction.
What's wrong with atan2(x1 - x2,y1 - y2)?

the jump from -180 to 180
This.  Well, that and the fact that atan2 is always y then x.
That can't be too hard to convert...
Logged

mak gam
Geisha Novia: Out now!
Bottoms Up!: Devlog

Royal Railway on Twitter.

Adam Emil
Fallsburg
Level 10
*****


Fear the CircleCat


View Profile WWW
« Reply #1462 on: January 21, 2011, 10:14:18 AM »

That can't be too hard to convert...

The y then x? Or the 180 -180 jump?  I agree that it isn't too hard to convert, but the bigger question is "Why bother?"  If one way requires extra work and one way doesn't, why wouldn't you go with the easier way (assuming that it is comparable in terms of computation or memory limits [whichever is more important])?
Logged

Glaiel-Gamer
Moderator
Level 10
******


Stoleurface!


View Profile WWW Email
« Reply #1463 on: January 21, 2011, 10:22:27 AM »

That can't be too hard to convert...

The y then x? Or the 180 -180 jump?  I agree that it isn't too hard to convert, but the bigger question is "Why bother?"  If one way requires extra work and one way doesn't, why wouldn't you go with the easier way (assuming that it is comparable in terms of computation or memory limits [whichever is more important])?

which angle is closer to 130, 20 or -160?
Logged

BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #1464 on: January 21, 2011, 12:38:33 PM »

That can't be too hard to convert...
Seriously, quit while you are ahead, and don't argue this. This isn't some matter of taste thing, vectors are just superior in 2d, and impossible to avoid in 3d (along with their bigger cousins, matrices and quaterions, which are equally vital).
  • Vastly faster
  • DRY - Don't you find it tedious writing virtually identical lines of code for x and y
  • Dot product and cross product replace virtually all geometry calculations with easier ones
  • No discontinities, double values (-180,180)
  • Natural - unlike angles you never worry about degrees vs radians, clockwise vs counterclockwise or what direction 0 is.
  • It allows directions, positions, and offsets to be manipulated by one framework.
  • Much mathematics on the reals carries over to vectors easily - Polynomials you learnt at school trivially become bezier splines. And vector notation means you can solve geometry problems without a diagram.
  • Works the same(ish) for 2d and 3d

That is not to say you can do everything with them (e.g. constant angular rotation with variable timestep), just that you should work in vectors, and convert when necessary, not the other way around.
Logged
Glaiel-Gamer
Moderator
Level 10
******


Stoleurface!


View Profile WWW Email
« Reply #1465 on: January 21, 2011, 12:55:07 PM »

vectors are also easily orientation-independent (useful for controls if your camera rotates)
Logged

Evan Balster
Level 10
*****


dreaming close to metal


View Profile WWW Email
« Reply #1466 on: January 21, 2011, 02:19:12 PM »

Quaternions.  <3  Something else I think kicks matrix ass.  (for the purpose of game logic programming--again, who wants to do expensive matrix ops twenty times per frame to calculate character physics?)

One confession, though:  My vector class is still named Point, and I don't have the heart to change it because "Vector" is a longer name, though I do have a typedef.  (I adhere rather strictly to 81-column lines in my code)
Logged

Infinite Blank, SoundSelf, Cave Story+, Wreath
voice, accordion, mandolin, (oboe, soon)
Game audio programming consultant.
<plaid/audio>: opensource audio framework
Glaiel-Gamer
Moderator
Level 10
******


Stoleurface!


View Profile WWW Email
« Reply #1467 on: January 21, 2011, 02:37:02 PM »

Quaternions.  <3  Something else I think kicks matrix ass.  (for the purpose of game logic programming--again, who wants to do expensive matrix ops twenty times per frame to calculate character physics?)

One confession, though:  My vector class is still named Point, and I don't have the heart to change it because "Vector" is a longer name, though I do have a typedef.  (I adhere rather strictly to 81-column lines in my code)

Vec2D/Vec3D is a shorter name
Logged

Pirate Hearts
Level 5
*****


PostCount++;


View Profile WWW Email
« Reply #1468 on: January 21, 2011, 02:47:29 PM »

Quaternions are pretty awesome, though I'll admit I've never really been able to wrap my mind around how they work and why they do what they do. I just like 'em because they're more convenient and efficient than rotation matrices in many cases.
Logged

Riley Adams
Level 5
*****


I don't actually use Ubuntu much...


View Profile
« Reply #1469 on: January 22, 2011, 02:00:25 AM »

Yay, got my network wrapping stuff mostly working (endians and all!).
Logged

Pages: 1 ... 96 97 [98] 99 100 ... 227
Print
Jump to:  

Theme orange-lt created by panic