English Amiga Board Suggestions for learning
 Register Amiga FAQ Rules & Help Members List  /  Moderators List Today's Posts Mark Forums Read

 24 June 2009, 14:30 #1 pmc gone   Join Date: Apr 2007 Location: completely gone Posts: 1,596 Suggestions for learning Hello boys. Have any of you more experienced guys got any suggestions for how a not so skilled coder (ie. me ) could go about learning some nicer mathematics & algorithms to help get more experienced and advanced? I'm looking to (try to...) learn things like: splines plotters vectors sorting and any other juicy stuff that you could suggest that might come in handy on the long road to trying to become a 'proper' coder. Books, web resources, any suggestions welcome!
 24 June 2009, 21:11 #2 Samurai_Crow Total Chaos forever!   Join Date: Aug 2007 Location: Waterville, MN, USA Age: 46 Posts: 1,653 http://en.wikipedia.org/wiki/Spline_(mathematics) tells about splines and links to other Wikipedia articles about them. Which kind of vectors are you trying to learn about? mathematical vectors or vector graphics? Sorting is pretty non-trivial. One important thing to note is that comparison based sorts have a time complexity of O(N log N) at the best. Index-based sorts like a Radix sort can go as fast as O(N).
24 June 2009, 21:18   #3
StingRay
move.l #\$c0ff33,throat

Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,624
Quote:
 Originally Posted by Samurai_Crow Which kind of vectors are you trying to learn about? mathematical vectors or vector graphics?
Excuse me? So vector graphics don't require math? That's what you're saying...

Anyway, some good info about vector graphics (also covers splines, sorting a.s.o.) can be found in 3dica. Not sure if it's suitable for beginners tho.

 24 June 2009, 21:20 #4 pmc gone   Join Date: Apr 2007 Location: completely gone Posts: 1,596 Thanks for replying Samurai_Crow. I've seen things like the Wikipedia article on splines. Unfortunately it's articles like that which make me think: err... say what? I don't even know how to read the mathematical representations of a spline curve that the article has. Maybe I'm trying to run before I can walk and I need mathematics lessons before I can start actually trying to use algorithms to solve programming problems... Last edited by pmc; 24 June 2009 at 21:26. Reason: Typo
 24 June 2009, 21:23 #5 pmc gone   Join Date: Apr 2007 Location: completely gone Posts: 1,596 @ StingRay: I must admit I wasn't sure of the difference between math vectors and vector graphics. I thought they both needed the mathematics of vectors, but then, what do I know? Clearly not much. Thanks for the link. I'll take a look.
 24 June 2009, 21:39 #6 wolfchild Registered User   Join Date: Jun 2008 Location: Malta Age: 44 Posts: 42 Hi, I don't post often here, but this is an interesting topic. Some time ago I found a nice tutorial on 3D graphics and vectors which might help you. http://chortle.ccsu.edu/VectorLessons/vectorIndex.html Cheers! Edwin
 24 June 2009, 21:54 #7 pmc gone   Join Date: Apr 2007 Location: completely gone Posts: 1,596 @ wolfchild: Nice one mate, appreciated - the comment and the link.
24 June 2009, 22:11   #8
wolfchild
Registered User

Join Date: Jun 2008
Location: Malta
Age: 44
Posts: 42
Quote:
 Originally Posted by pmc @ wolfchild: Nice one mate, appreciated - the comment and the link.
I look forward to do the tutorial some day. It's a long standing ambition of mine to be able to do 3D vectors on the Amiga, but it's intimidating (got to learn 68k assembler, the chipset, the OS and math). But people like you give me courage. I enjoyed your Oldskool demo.

Edwin

25 June 2009, 08:29   #9
Vortex
Used Register

Join Date: Nov 2008
Age: 47
Posts: 103
Quote:
 Originally Posted by Wolfchild I look forward to do the tutorial some day. It's a long standing ambition of mine to be able to do 3D vectors on the Amiga, but it's intimidating (got to learn 68k assembler, the chipset, the OS and math). But people like you give me courage. I enjoyed your Oldskool demo. Edwin
Thanks for the link to this excellent tutorial WolfChild.

 25 June 2009, 09:13 #10 pmc gone   Join Date: Apr 2007 Location: completely gone Posts: 1,596 @ Wolfchild. Cheers buddie. I say never mind 'one day', just do it. Ask yourself this: is it better to try to succeed and fail or fail to even try to succeed? Trust me, if I can get anything even working in asm code then anyone else can - coding really doesn't come naturally to me at all - so go for it and surprise yourself.
25 June 2009, 11:58   #11
pmc
gone

Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
 Originally Posted by Vortex Thanks for the link to this excellent tutorial WolfChild.
Now that I've done a bit of reading of it, allow me to echo that sentiment wolfchild. This is a really good tutorial, just the way I like it - words of one syllable and very clear

Even I'm beginning to understand how vector graphics might be done. There's still a loooooong way to go before I try coding some though I might add.

Hey Vortex, I've got this crazy notion that I'd like to make a hidden line vector routine for our little collaboration. Perhaps in that case "by 2024" is looking a bit optimistic but you never know!

I really like hidden line vectors and from my experience of old skool demos you don't really see them that often - you normally either get lines or filled.

I've ordered a couple of books on common algorthims and how to go about building algorithms. Perhaps with what I learn from the tutorials plus some learning about good algorithms related to doing things with vector graphics I might get there...

25 June 2009, 13:28   #12
Vortex
Used Register

Join Date: Nov 2008
Age: 47
Posts: 103
Quote:
 Originally Posted by pmc Now that I've done a bit of reading of it, allow me to echo that sentiment wolfchild. This is a really good tutorial, just the way I like it - words of one syllable and very clear Even I'm beginning to understand how vector graphics might be done. There's still a loooooong way to go before I try coding some though I might add. Hey Vortex, I've got this crazy notion that I'd like to make a hidden line vector routine for our little collaboration. Perhaps in that case "by 2024" is looking a bit optimistic but you never know! I really like hidden line vectors and from my experience of old skool demos you don't really see them that often - you normally either get lines or filled. I've ordered a couple of books on common algorthims and how to go about building algorithms. Perhaps with what I learn from the tutorials plus some learning about good algorithms related to doing things with vector graphics I might get there...
Sounds good pmc. 3D is interesting stuff indeed .
Ordering books! Woot, you mean business

 26 June 2009, 21:47 #13 Apollo Registered User   Join Date: Sep 2008 Location: Germany Age: 46 Posts: 128 Dont forget "fixed point" arithmetic. Sooner or later you'll going to need it. Not only for 3D stuff.... A good page for information about fixed point math is e.g. the site from ray/tscc. Though he is a Atari ST 68k brother, many things are valid for our girlfriend, too. http://freenet-homepage.de/ray.tscc/index.htm
 26 June 2009, 22:53 #14 pmc gone   Join Date: Apr 2007 Location: completely gone Posts: 1,596 Nice one Apollo. More interesting stuff to read.
26 June 2009, 23:08   #15
StingRay
move.l #\$c0ff33,throat

Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,624
Quote:
 Originally Posted by Apollo Dont forget "fixed point" arithmetic. Sooner or later you'll going to need it. Not only for 3D stuff....
Indeed, fixed point is useful for many things. However, it's not very complex either. I learnt to hate it when I tried to code a perspective correct texture mapper that doesn't need FPU though. ;D (N.B.: I never got it to work 100% despite a lot of trickery ;D)

30 June 2009, 09:17   #16
pmc
gone

Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
 Originally Posted by StingRay However, it's not very complex either.
Speak for yourself Mr.Coding Guru

For the last several days I've been reading about dot products, matrices, scalars, right hand rules and lord knows what else. Still not sure I'm any the wiser how to make spinning cubes.

 30 June 2009, 09:53 #17 CodyJarrett Global Moderator   Join Date: Mar 2001 Location: UK Age: 43 Posts: 5,953 "3D Math Primer for Graphics and Game Development" is a good introductory book: http://www.amazon.co.uk/Primer-Graph.../dp/1556229119
 30 June 2009, 11:55 #18 pmc gone   Join Date: Apr 2007 Location: completely gone Posts: 1,596 Thanks for the tip CJ If only I knew C++ as well - would be really good to not only understand the maths in the book but to understand the code examples too. Don't suppose there's much of a market for this kind of work with example implementations in 68000 asm anymore though. Really can't be bothered learning C as well as all this other stuff - makes no sense for me anyway - the only thing I wanna do is code Amiga demos. Anyway, based on your personal recommendation, book ordered.
 03 July 2009, 16:55 #19 korruptor TDI   Join Date: Feb 2007 Location: DUNDEE Posts: 123 Another recommendation for that book. It's very good to get you going. Just start with a simple data structure for some 2D points, CPU plot them, then try and pre-calc a matrix to get them rotating. Once you're there you'll have a good feel for it and be able to add in the Z axis, perspective and projection so you've got some simple 3D rotation. It's not too bad once you get over the hump, but I'd recommend you double check all your maths, either in the debugger or a high level language when you're doing it, as it's easy to screw up the matrix implementation and not realise for ages. I know There's loads of good info on line drawing (just nick a reasonable algo to get going) and blitter filling from there shouldn't be too hard. I was scared off from vectors and matrices for a long time, but once you start knocking it up, the basics aren't that scary at all.
03 July 2009, 21:19   #20
wolfchild
Registered User

Join Date: Jun 2008
Location: Malta
Age: 44
Posts: 42
Quote:
 Originally Posted by korruptor ... Just start with a simple data structure for some 2D points, CPU plot them, then try and pre-calc a matrix to get them rotating. ...
Well, following korruptor's suggestion, and being somewhat bored at work, I hacked a quick and dirty 2D line rotation routine in C#, as it was what I had available. Executable and source code are attached.

Once you get over the math, which looks daunting but is not, it's easy to expand on concepts.

I used this page as a reference : http://en.wikipedia.org/wiki/Transformation_matrix , though I must say that I have studied trigonometry and matrix math quite recently as part of my uni studies.

Line plot is timer triggered (analogous to the Amiga's vertical refresh).

I precalculate the sine and cosine at the beginning of the transformation function, thus halving the calculations. Bigger gains will come into play when rotating more points. On the Amiga, one would store a quadrant and play with different offsets into the sine table, thus creating sin/cos.

The killer for the Amiga would be the 4 multiplications involved. I don't see a way of getting rid of these.

Cheers!
Edwin
Attached Files
 MatrixRotation.zip (33.6 KB, 282 views)

Last edited by wolfchild; 03 July 2009 at 22:31. Reason: Updated attachment

 Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 Similar Threads Thread Thread Starter Forum Replies Last Post Peter Retrogaming General Discussion 15 28 October 2015 17:17 XDelusion support.Apps 19 20 October 2012 23:57 fishyfish Coders. Asm / Hardware 5 03 March 2012 06:11 girv Retrogaming General Discussion 5 24 March 2009 22:00 bLAZER Coders. General 1 12 May 2007 05:00

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home News Main     Amiga scene     Retrogaming General Discussion     Nostalgia & memories Support     New to Emulation or Amiga scene         Member Introductions     support.WinUAE     support.WinFellow     support.OtherUAE     support.FS-UAE         project.AmigaLive     support.Hardware         Hardware mods         Hardware pics     support.Games     support.Demos     support.Apps     support.Amiga Forever     support.Amix     support.Other Requests     request.UAE Wishlist     request.Old Rare Games     request.Demos     request.Apps     request.Modules     request.Music     request.Other     Looking for a game name ?     Games images which need to be WHDified abime.net - Hall Of Light     HOL news     HOL suggestions and feedback     HOL data problems     HOL contributions abime.net - Amiga Magazine Rack     AMR news     AMR suggestions and feedback     AMR data problems     AMR contributions abime.net - Home Projects     project.Amiga Lore     project.EAB     project.IRC     project.Mods Jukebox     project.Wiki abime.net - Hosted Projects     project.aGTW     project.APoV     project.ClassicWB     project.Jambo!     project.Green Amiga Alien GUIDES     project.Maptapper     project.Sprites     project.WinUAE - Kaillera Other Projects     project.Amiga Demo DVD     project.Amiga Game Factory     project.CARE     project.Amiga File Server     project.CD32 Conversion     project.Game Cover Art         GCA.Feedback and Suggestions         GCA.Work in Progress         GCA.Cover Requests         GCA.Usefull Programs         GCA.Helpdesk     project.KGLoad     project.MAGE     project.Missing Full Shareware Games     project.SPS (was CAPS)     project.TOSEC (amiga only)     project.WHDLoad         project.Killergorilla's WHD packs Misc     Amiga websites reviews     MarketPlace         Swapshop     Kinky Amiga Stuff     Collections     EAB's competition Coders     Coders. General         Coders. Releases         Coders. Tutorials     Coders. Asm / Hardware     Coders. System         Coders. Scripting         Coders. Nextgen     Coders. Language         Coders. C/C++         Coders. AMOS         Coders. Blitz Basic     Coders. Contest         Coders. Entries Creation     Graphics         Graphics. Work In Progress         Graphics. Finished Work         Graphics. Tutorials     Music         Music. Work In Progress         Music. Finished Work         Music. Tutorials

All times are GMT +2. The time now is 09:35.

 -- EAB3 skin ---- EAB2 skin ---- Mobile skin Archive - Top