A.D.A. Amiga Demoscene Archive

  Welcome guest! Please register a new account or log in

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / coding tutorial: the blitter
 Page:  ««  1  2  
Author Message
Cyf
Member
#1 - Posted: 3 Jan 2005 11:30 - Edited
Reply Quote
about Octants :


line coord (x1,y1)(x2,y2)
dx=|x1-x2|
dy=|y1-y2|

binary code
0=000 : y1<y2, x1<x2, dx<dy
1=001 : y1>y2, x1<x2, dx<dy
2=010 : y1<y2, x1>x2, dx<dy
3=011 : y1>y2, x1>x2, dx<dy
4=100 : y1<y2, x1<x2, dx>dy
5=101 : y1<y2, x1>x2, dx>dy
6=110 : y1>y2, x1<x2, dx>dy
7=111 : y1>y2, x1>x2, dx>dy

if dx>dy, the third octant bit is 1
octant is coded : Dxx with D = Delta X and Delta Y

dx>dy
0=000 : y1<y2, x1<x2
1=001 : y1>y2, x1<x2
2=010 : y1<y2, x1>x2
3=011 : y1>y2, x1>x2

dx<dy
4=100 : y1<y2, x1<x2
5=101 : y1<y2, x1>x2
6=110 : y1>y2, x1<x2
7=111 : y1>y2, x1>x2

octant is code 1AB or 0BA
A=1 if y1>y2 and B=1 if x1>x2
A=0 if y1<y2 and B=0 if x1<x2
toffeeman
Member
#2 - Posted: 6 Nov 2005 00:25
Reply Quote
The second screen shot is a dot effect surley ? Which wouldn't use the blitters line draw.
 Page:  ««  1  2  

  Please register a new account or log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0