Live data from Hacker News

The cursed d65536

aleph.se

71–74 of 74 posts

Re: The cursed d65536

#71
post #66

Earlier quoted context omitted.

I mean, as far as correctness as concerned, of course it works, but performance-wise in a raytracer I was toying around with it was a dismal failure compared to the (traditionally shunned) analytic approach. The issue, as far as I understand it, is that LuaJIT only handles traces of two shapes: linear code; or linear loop prologue followed by linear loop body. The conditions of any branches (that could not be determi…

This is a cool story! Is that vector library public or is it an internal project? I'd love to take a look at the rest of it...

The raytracer itself is not in a state I’d want to inflict on anybody. The vector library is just HLSL-style small vectors with subpar error reporting, there’s like half a dozen of those floating around, but if you want it, sure, go wild: http://ix.io/3ZQk (CC0). I’d only ask you to hold off on posting it to LuaRocks under that name because I want to do that myself eventually.

Re: The cursed d65536

#72
post #66

Earlier quoted context omitted.

This is a cool story! Is that vector library public or is it an internal project? I'd love to take a look at the rest of it...

The raytracer itself is not in a state I’d want to inflict on anybody. The vector library is just HLSL-style small vectors with subpar error reporting, there’s like half a dozen of those floating around, but if you want it, sure, go wild: http://ix.io/3ZQk (CC0). I’d only ask you to hold off on posting it to LuaRocks under that name because I want to do that myself eventually.

Thanks! Sure, I'm not planning on reposting the code, I just collect LuaJIT stories.

Re: The cursed d65536

#73
post #18
post #15

Earlier quoted context omitted.

Pedantry: it doesn’t have to be flat - for example a triangulated parabola could also have that configuration. You only get a topological result from just knowing edge and vertex counts. Now if the triangles are identical equilateral then you’re in business. What if the triangles are all congruent but not equilateral? Can that even happen? That’s a fun one, so I won’t spoil it.

Oh, do you think it could make a sphere then? If the angle at each triangle corner is a bit less than 60 degrees?

Not a sphere, we know that can’t happen due to the topological constraint you brought up. Instead picture a float plane tiled by equilateral triangles. Now mark each vertex as either low, middle, or high such that every triangle has one of each. Push the low ones below the plane and the high vertices above the plane by some amount x. Now it’s a bumpy plane full of triangles, each one is isosceles and all identical.

I think that’s the only way to do this, but maybe there are more. Could we get a hyperbolic plane this way? Normally you squeeze extra triangles around each vertex to do that so I doubt it but maybe.

Re: The cursed d65536

#74
post #22

Earlier quoted context omitted.

This process has an infinitely small (but non-zero) chance of never terminating.

Actually, it doesn't. If you're working with real numbers, then your step counter is a natural number, you repeat for[2] infinitely many steps, and the probability of failure is exactly zero. If, on the hand, you're working with surreal numbers - which you would have to be for "infinitely small (but non-zero)" to make sense - then your step counter is a ordinal number[1], not a natural, and you repeat for[2] non-well…

> ordinal number[1]

> 1: ie, a positive whole surreal number, rather than a positive whole real number

Actually, ordinals have some additional contraints besides just "positive" and "whole" (eg ω−1 is not a ordinal), that just reduce to "positive whole" in the case of reals, although that doesn't change the actual point any.

Post reply on HN