mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-08-03 20:34:04 +00:00
perspective_to_psace in 3D
This commit is contained in:
parent
233adddd36
commit
bacdacbb7f
@ -44,6 +44,7 @@ EX hyperpoint perspective_to_space(hyperpoint h, ld alpha IS(vid.alpha), eGeomet
|
|||||||
return hpxy(hx * (1 + alpha), hy * (1 + alpha));
|
return hpxy(hx * (1 + alpha), hy * (1 + alpha));
|
||||||
|
|
||||||
ld hr = hx*hx+hy*hy;
|
ld hr = hx*hx+hy*hy;
|
||||||
|
if(LDIM == 3) hr += h[2]*h[2];
|
||||||
|
|
||||||
if(hr > .9999 && gc == gcHyperbolic) return Hypc;
|
if(hr > .9999 && gc == gcHyperbolic) return Hypc;
|
||||||
|
|
||||||
@ -65,6 +66,7 @@ EX hyperpoint perspective_to_space(hyperpoint h, ld alpha IS(vid.alpha), eGeomet
|
|||||||
hyperpoint H;
|
hyperpoint H;
|
||||||
H[0] = hx * (hz+alpha);
|
H[0] = hx * (hz+alpha);
|
||||||
H[1] = hy * (hz+alpha);
|
H[1] = hy * (hz+alpha);
|
||||||
|
if(LDIM == 3) H[2] = h[2] * (hz + alpha);
|
||||||
H[LDIM] = hz;
|
H[LDIM] = hz;
|
||||||
|
|
||||||
return H;
|
return H;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user