donut.c

i wonder where the mistake is in here, i've read over https://www.a1k0n.net/2011/07/20/donut-math.html and thought i'd give it a try, but without magic transformation matrices and with some resemblance to a proper pipeline. the result i get looks somewhat like a torus, but not really one https://gist.github.com/rossiyareich/286b387a2bdfb59eeada23bdb59e7be9
Gist
Donut.cs
GitHub Gist: instantly share code, notes, and snippets.
10 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
i love cat(mull-rom splines)
custom type
using System.Numerics;

namespace SpinningDonut;

internal struct Point3
{
public Vector3 Position;
public Vector3 Normal;

public Point3(Vector3 position, Vector3 normal)
{
Position = position;
Normal = normal;
}
}
using System.Numerics;

namespace SpinningDonut;

internal struct Point3
{
public Vector3 Position;
public Vector3 Normal;

public Point3(Vector3 position, Vector3 normal)
{
Position = position;
Normal = normal;
}
}
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
mtreit
mtreit3y ago
Ooh, a c# port of the donut program from the obfuscated c contest?
i love cat(mull-rom splines)
from the article i dont understand the obfuscated c too as it premultiplies the transformation matrix
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
mtreit
mtreit3y ago
The code...is a donut...
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
i love cat(mull-rom splines)
i hate it when stuff almost works but doesnt whatever, i'll just leave it at this i thought about writing a software rasterizer and creating a 3d console engine but from doing this i don't think it's going to be particularly fun or performant back to doing unity catcorn
Want results from more Discord servers?
Add your server