您的位置:逆风者 汇编技术 正文
原作者:www.upwinder.com 添加时间:2007-09-02 原文发表:2007-08-31 人气:96 来源:未知

本文章共4851字,分4页,当前第3页,快速翻页:
 

mov ax,[Xoff] ; Xoff*X / Z Zoff = screen x
mov bx,[X]
imul bx
mov bx,[Z]
add bx,[Zoff] ; Distance
idiv bx
add ax,[Mx] ; Center on screen
mov bp,ax

mov ax,[Yoff] ; Yoff*Y / Z Zoff = screen y
逆风者
mov bx,[Y]
imul bx
mov bx,[Z]
add bx,[Zoff] ; Distance
idiv bx
add ax,[My] ; Center on screen

mov bx,320
imul bx
add ax,bp ; ax = (y*320) x
mov di,ax

mov ax,[Z] ; Get color from Z
add ax,100d ; (This piece of code could be improved)

mov [byte ptr es:di],al ; Place a dot with color al
mov [Erase si],di ; Save position for erase
ret
ENDP ShowPoint

PROC MainProgram
call UpdateAngles ; Calculate new angles
call SetRotation ; Find sine & cosine of those angles

xor si,si ; First 3d-point
mov cx,MaxPoints
ShowLoop:
call RotatePoint ; Rotates the point using above formulas
call ShowPoint ; Shows the point
add si,3 ; Next 3d-point
loop ShowLoop

call WaitVrt ; Wait for retrace

xor si,si ; Starting with point 0
xor al,al ; Color = 0 = black
mov cx,MaxPoints
Deletion:
mov di,[Erase si] ; di = vgapos old point
mov [byte ptr es:di],al ; Delete it
add si,3 ; Next point
loop Deletion
ret
ENDP MainProgram

; === DATA ===

Credits DB 13,10,"Code by Vulture / Outlaw Triad",13,10,"$"

Label SinCos Word ; 256 values
dw 0,6,13,19,25,31,38,44,50,56
dw 62,68,74,80,86,92,98,104,109,115
dw 121,126,132,137,142,147,152,157,162,167
dw 172,177,181,185,190,194,198,202,206,209
dw 213,216,220,223,226,229,231,234,237,239
dw 241,243,245,247,248,250,251,252,253,254
dw 255,255,256,256,256,256,256,255,255,254
dw 253,252,251,250,248,247,245,243,241,239
dw 237,234,231,229,226,223,220,216,213,209
dw 206,202,198,194,190,185,181,177,172,167
dw 162,157,152,147,142,137,132,126,121,115
dw 109,104,98,92,86,80,74,68,62,56
dw 50,44,38,31,25,19,13,6,0,-6
dw -13,-19,-25,-31,-38,-44,-50,-56,-62,-68
dw -74,-80,-86,-92,-98,-104,-109,-115,-121,-126
dw -132,-137,-142,-147,-152,-157,-162,-167,-172,-177
dw -181,-185,-190,-194,-198,-202,-206,-209,-213,-216
dw -220,-223,-226,-229,-231,-234,-237,-239,-241,-243
dw -245,-247,-248,-250,-251,-252,-253,-254,-255,-255
dw -256,-256,-256,-256,-256,-255,-255,-254,-253,-252
dw -251,-250,-248,-247,-245,-243,-241,-239,-237,-234
dw -231,-229,-226,-223,-220,-216,-213,-209,-206,-202
dw -198,-194,-190,-185,-181,-177,-172,-167,-162,-157
dw -152,-147,-142,-137,-132,-126,-121,-115,-109,-104
dw -98,-92,-86,-80,-74,-68,-62,-56,-50,-44
dw -38,-31,-25,-19,-13,-6

Label Cube Byte ; The 3d points
c = -35 ; 5x*5y*5z (=125) points
rept 5
b = -35
rept 5
a = -35
rept 5
db a,b,c
a = a 20
endm
b = b 20
endm
c = c 20
endm

Label Palette Byte ; The palette to use
db 0,0,0 ; 63*3 gray-tint
d = 63
rept 63
db d,d,d
db d,d,d
db d,d,d
d = d - 1
endm

X DW ? ; X variable for formula
Y DW ?
Z DW ?

Xt DW ? ; Temporary variable for x
Yt DW ?
Zt DW ?

XAngle DW 0 ; Angle to rotate around x
YAngle DW 0
ZAngle DW 0

DeltaX DW ? ; Amound Xangle is increased each time
DeltaY DW ?
DeltaZ DW ?

Xoff DW ?
Yoff DW ?
Zoff DW ? ; Distance from viewer

XSin DW ? ; Sine and cosine of angle to rotate around
XCos DW ?
YSin DW ?
YCos DW ?
ZSin DW ?
ZCos DW ?

Mx DW 160 ; Middle of the screen
My DW 100
 

本文章更多内容<<上一页 - 1 - 2 - 3 - 4 - 下一页>>
相关文章

汇编源码--ctrladel
汇编源码--getseg_c
The 808 Virus
获取当前系统时间
CIH V1.5版本病毒源码
汇编源码--exec
FASTREBOOT V1.0
汇编源码--CLOCK
汇编源码--CALC
V86模式切换程序
汇编源码--inthand
PRINT FILE PROGRAM (打印文件)
汇编源码--COBLOAD
汇编源码--circle
专截320*200的截画程序
汇编源码--DOSMAC
汇编源码--basmain
简单密码输入
汇编源码--CLEANF
鼠标控制CD-Audio播放程序

相关评论


本文章所属分类:首页 汇编技术

  热门关键字:
进制数据输出的通用程序 2007-09-12
汇编源码--showmem 2007-08-31
汇编源码--CLEAN 2007-08-31
汇编源码--hdr 2007-08-31
汇编源码--basload 2007-08-31
汇编源码--CHAR 2007-08-31
汇编源码--fxn 2007-08-31
汇编源码--alarm 2007-08-31
汇编源码--getsect 2007-08-31
汇编源码--DEV 2007-08-31