Skip to content

Commit

Permalink
Added moving floor, and solved bug of reversed Z in floor texture map…
Browse files Browse the repository at this point in the history
…ping
  • Loading branch information
nanochess committed Apr 15, 2024
1 parent 83a2aa7 commit 86db9ff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ray.asm
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,18 @@ e5:
fldz
fcomip ; Remove second operand.
jbe e6
fstp st0
fld dword [bp+var_y]
fadd dword [si]
fdiv dword [bp+var_v]
fdivrp
fst dword [bp+var_p] ; Perspective correction.

fmul dword [bp+var_u] ; Adjust coordinates.
fsubr dword [bp+var_x]
frndint
fld dword [bp+var_w]
fmul dword [bp+var_p]
fsubr dword [bp+var_z]
fadd dword [bp+var_z]
fadd dword [bp+var_a] ; Moving floor.
frndint
faddp
fst dword [bp+var_s]
Expand Down Expand Up @@ -264,13 +264,13 @@ sphere:
fmul dword [bp+var_u]

fld dword [bp+var_y] ; Origin of ray.
fsub dword [bp+var_i] ; Minus sphere position.
fsub dword [bp+var_i] ; Minus sphere position.
fst dword [bp+var_f]
fmul dword [bp+var_v]

faddp

fld dword [bp+var_z]
fld dword [bp+var_z] ; Origin of ray.
fst dword [bp+var_g]
fmul dword [bp+var_w]

Expand Down
Binary file modified ray.com
Binary file not shown.
Binary file modified ray.img
Binary file not shown.

0 comments on commit 86db9ff

Please sign in to comment.