Welcome, Guest. Please login or register.

Author Topic: Help needed with a very silly idea...  (Read 8377 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline woof

  • Jr. Member
  • **
  • Join Date: Feb 2003
  • Posts: 94
    • Show all replies
    • http://uae.is.free.fr
Re: Help needed with a very silly idea...
« on: January 20, 2005, 05:54:26 PM »

If your shape is in ONE piece then you can
For (say) a Screen 640x480
scan vertical lines separated by 80 pixels
(y=0 80 160 240 320 400)
if nothing hitted
continue with
(y=1 81 161 241 321 401)
etc...
When a line hitted say 241 then finish 319 -> 242
Idem in X
:-)

Alain
 
 

Offline woof

  • Jr. Member
  • **
  • Join Date: Feb 2003
  • Posts: 94
    • Show all replies
    • http://uae.is.free.fr
Re: Help needed with a very silly idea...
« Reply #1 on: January 27, 2005, 09:46:49 PM »
>I don't see why you need to scan vertically
All right i said vertically but you can scan first horizontally : but my idea was to not scan each line after
another (but skip N lines) so IF the shape is at the bottom (or right) of the screen you hit at first time only in several scan lines not by scanning all lines (or colonnes)

>Also by scanning vertically u arereading from RAM non->sequentially is very slow.
Absolutely right :-)

BTW with Altivec u can do massive compare of datas
some instructions on UBYTEs
vavgub         Average 16 UBYTE   
vcmpgtsb      Compare Greater-Than of 16 BYTE   
vmaxub         Maximum of 16 UBYTE   
vminub         Minimum of 16 UBYTE
etc...

Alain :-D