20 July 2009, 02:39 | #1 |
Posts: n/a
|
2D Rotation problem
Finally my 2D rotator seems to rotate, at least sort of.
Still having huge problems to make it work right. After a while (angle value 150+), my x values goes out of the screen for no good reason I got the same routine working with blitz basic (without sintable and with calculated radians). So my lucky guess is that my sintable still sucks. It's created with following: IS 0,450,1280,256,0,w,1,y,y This should create sintable with 1.25 perioids and max value 256, so i can easily divide the result with 256 (asr.l #8). Anyone got ideas what i'm still doing wrong? Full source: http://paradise.untergrund.net/tmp/2dRot.s |
20 July 2009, 12:06 | #2 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Didn't check the code but my best bet is: sub.w d3,d2 is cause of your problem, it should be sub.l d3,d2.
|
20 July 2009, 12:35 | #3 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
The muls.w instruction produces a 32 bit product, and when you tell ASM-One to create a sinus table for this purpose you should select no half correction.
|
20 July 2009, 14:00 | #4 | |
Posts: n/a
|
Quote:
Leffmann: Changed the sinustable also. Could you please explain a little why half correction doesn't work here? |
|
20 July 2009, 15:28 | #5 | ||
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
Quote:
You sensed a disturbance in the code! Gonna start calling you Obi-Wan |
||
20 July 2009, 16:21 | #6 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
I think it adds half a degree to each degree for which it calculates a sine. There are times when you want this but for this sort of lookup table you want exact values, and if you inspect your table you will see there are no values equivalent to -1 and 1, which you would expect for all the right angles.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mike the Magic Dragon: in-game problem or WinUAE problem? | petran | support.WinUAE | 33 | 16 August 2023 20:29 |
C: Image rotation algorithm problem | TikTok | Coders. General | 20 | 19 August 2019 20:15 |
Rotation matrix | tolkien | Coders. General | 7 | 29 March 2013 10:32 |
aspi problem (was: auto resize problem) | Kyon | support.WinUAE | 34 | 31 May 2009 16:56 |
Problem with Kickstarts [rare problem with faulty scripts in early v1.1 release] | Topgun | project.GameBase Amiga | 14 | 08 June 2006 22:19 |
|
|