From 2993dadb56467ef82865d227c4041ddc192e6711 Mon Sep 17 00:00:00 2001 From: Miloslav Ciz Date: Wed, 29 Jun 2022 21:51:01 +0200 Subject: [PATCH] Update --- raycasting.md | 8 ++++---- recursion.md | 2 +- selfless.md | 23 ----------------------- sw_rendering.md | 2 +- 4 files changed, 6 insertions(+), 29 deletions(-) delete mode 100644 selfless.md diff --git a/raycasting.md b/raycasting.md index fbe2b99..031c201 100644 --- a/raycasting.md +++ b/raycasting.md @@ -233,8 +233,8 @@ int main(void) while (!quit) { - int forwX = cos((2 * 3.14 * camAngle) / ((float) U) ) * U, - forwY = sin((2 * 3.14 * camAngle) / ((float) U) ) * U, + int forwX = cos(2 * 3.14 * camAngle) * U, + forwY = sin(2 * 3.14 * camAngle) * U, vecFromX = forwX + forwY, // leftmost ray vecFromY = forwY - forwX, vecToX = forwX - forwY, // rightmost ray @@ -261,8 +261,8 @@ int main(void) switch (c) // movement { - case 'a': camAngle -= 30; break; - case 'd': camAngle += 30; break; + case 'a': camAngle += 30; break; + case 'd': camAngle -= 30; break; case 'w': camX += forwX / 2; camY += forwY / 2; break; case 's': camX -= forwX / 2; camY -= forwY / 2; break; case 'q': quit = 1; break; diff --git a/recursion.md b/recursion.md index 49a9225..239ccea 100644 --- a/recursion.md +++ b/recursion.md @@ -4,7 +4,7 @@ In general recursion is a situation in which a [definition](definition.md) refers to itself; for example the definition of a human's ancestor as "the human's parents and the ancestors of his parents" ([fractals](fractal.md) are also very nice example of what a simple recursive definition can achieve). In programming recursion takes on a meaning of a **function that calls itself**; this is the meaning we'll suppose in this article, unless noted otherwise. -We divide recursion to a **direct** and **indirect** one. In direct recursion the function calls itself directly, in indirect function *A* calls a function `B` which ends up (even possibly by calling some more functions) calling *A* again. Indirect recursion is tricky because it may appear by mistake and cause a [bug](bug.md) (which is nevertheless easily noticed as the program will mostly run out of memory and crash). +We divide recursion to a **direct** and **indirect** one. In direct recursion the function calls itself directly, in indirect function *A* calls a function *B* which ends up (even possibly by calling some more functions) calling *A* again. Indirect recursion is tricky because it may appear by mistake and cause a [bug](bug.md) (which is nevertheless easily noticed as the program will mostly run out of memory and crash). When a function calls itself, it starts "diving" deeper and deeper and in most situations we want this to stop at some point, so in most cases **a recursion has to contain a terminating condition**. Without this condition the recursion will keep recurring and end up in an equivalent of an infinite loop (which in case of recursion will however crash the program with a [stack overflow](stack_overflow.md) exception). Let's see this on perhaps the most typical example of using recursion, a [factorial](factorial.md) function: diff --git a/selfless.md b/selfless.md deleted file mode 100644 index ba9433d..0000000 --- a/selfless.md +++ /dev/null @@ -1,23 +0,0 @@ -# Selflessness - -Selflessness is the opposite of [self interest](self_interest.md). That is: being selfless means acting in ways that help everyone as opposed to oneself. Under our definition *everyone* also includes *self*, so selflessness doesn't mean not helping oneself -- helping self is okay as long as it also helps everyone else equally or more. - -Selflessness is extremely important in [LRS](lrs.md): our technology must be maximally helpful to everyone which excludes any malicious features such as [proprietary code](proprietary.md), [bloat](bloat.md), [ads](ad.md), legal conditions (even [free](free_software.md)), [spyware](spyware.md) and other malware or anything that makes the program worse for the general user in order to specially benefit the program's author. - -This is in stark contrast with [capitalist software](capitalist_software.md) that's by definition made solely for its creator's profit and is only as helpful to others as that serves the ultimate goal. - -## Money - -The greatest challenge of selfless software is its development under capitalist society which is highly hostile to selflessness by its strict application of the tyranny of economy onto all areas. In a better society where humans would be free to invest their time freely the issue wouldn't be present; sadly most people are slaves forced to work every day for their food and therefore prevented from creating anything that doesn't bring them money. - -So, under current conditions, we have to ask: **Can we charge money for selfless software?** Here we give an answer similar to that of [free software](free_software.md): **It is not wrong to collect money for software as long as this doesn't limit its users, i.e. only completely optional payment is acceptable.** This is in accordance with our definition of selflessness: with optional payment the technology doesn't get worse for anyone and its author simply gets basic resources (food, water, ...) from people who can afford and are willing to share them, by means compatible with the current socioeconomic system. By this we at least somewhat simulate the ideal society in which people do what they truly want because they get basic resources for living. - -But **BEWARE**: charging money, even optionally, may introduce subconscious bias towards wanting to earn more and implementing malicious features, and so **it is better to not ask money if it's not needed**, for example if the author already has enough money for comfortable living. By staying completely non-commercial it is better assured the goal remains pure. - -## Recommendations - -Try to follow this advice in order to achieve high selflessness of your technology: - -- **Use [public domain](public_domain.md) waiver** (such as [CC0](cc0.md)), do NOT try to "own" your software in any way and do NOT use licenses with conditions such as attribution, do not seek fame (if your software is good, you will become famous anyway, even without any attribution conditions). This doesn't mean you have to stay anonymous, that can in many situations be worse for everyone. -- **Do not charge money** for the program if you don't have to, and if you do, **make the payment completely optional**. -- **Always have the definition of selflessness on your mind** and from time to time ask yourself whether you're still faithful to it. Ask yourself what's the true goal of your project. \ No newline at end of file diff --git a/sw_rendering.md b/sw_rendering.md index 66cf873..5b74e42 100644 --- a/sw_rendering.md +++ b/sw_rendering.md @@ -24,7 +24,7 @@ Some SW renderers make use of specialized CPU instructions such as [MMX](mmx.md) These are some notable software renderers: -- **[Build engine](build_engine.md)**: While not a "true 3D", this was a very popular [proprietary](proprietary.md) [BSP rendering](bsp.md) engine for older games like Duke Nukem 3D or Blood. +- **[Build engine](build_engine.md)**: While not a "true 3D", this was a very popular [proprietary](proprietary.md) portal-rendering engine for older games like Duke Nukem 3D or Blood. - **[BRender](brender.md)**: Old [proprietary](proprietary.md) commercial renderer used in games such as Carmageddon, Croc or Harry Potter 1. - **[id Tech](id_tech.md)**: Multiple engines by [Id software](id.md) (later made [FOSS](foss.md)) used for games like [Quake](quake.md) included a software renderer. - **[Irrlich](irrlicht.md)**: [FOSS](foss.md) game engine including a software renderer as one of its [backends](backend.md).