flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
pool
..
Last edited by pool on 17 Mar 2013, 11:44; edited 1 time in total |
|||
![]() |
|
bitRAKE
square root is more complicated:
Code: Sqrt: xor ecx,ecx xor eax,eax bsr edx,[esp+4] je .x and edx,-2 ; even bts ecx,edx .0: add eax,ecx sub [esp+4],eax jnc .1 add [esp+4],eax sub eax,ecx jmp .2 .1: add eax,ecx .2: shr eax,1 shr ecx,2 jne .0 .x: retn 4 ; EAX = square root |
|||
![]() |
|
pool
..
Last edited by pool on 17 Mar 2013, 11:44; edited 1 time in total |
|||
![]() |
|
edfed
for that, don't try square root.
the square is enough to know the distance. and in 3D, the principle is to simplify the equation, then, the algo will be little. x2D = k (x/z) y2D = k (y/z) |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.