DEV Community

Cover image for New way to do graphics. X E.
Josiah
Josiah

Posted on

New way to do graphics. X E.

How it works

To start, we have 3+ dimensional Euclidean points, shapes made of those points which are all straight line, polygons that are planar, lines, and points. We then project to 2d view plane by a defined view space XYZ and eye center point. Then group/cluster by what is in same exact space in 2d view plane.

Here comes unique part

Then cut so that if perimeters intersect then cut so they do not and if planes intersect then cut so that they do not. Draw order by a single corresponding by 2d view plane's z on each shape until a match or 3 not collinear points are considered. Then tesselate and draw in groups as ordered only within groups. Like we have 10 shape group 1 and 50 shape group 2, that is an entire separate 10 and 50. I have math mostly worked out for this.

What you can do

https://github.com/maybeJosiah/RinomXE-general, what I have now. I also have Slang shaders. I am looking for contributors. Rust, Slang, and whatever you want to test in with compute shaders. All this is and will remain open source.

Some math

Rotating from straight, we can find how off from straight from a z direction a line is and by extension how much z is needed. Also, if in same +- all dimensions then divide by a unit distance and multiply by another giving greater than 1. For plane p1-p3 not all collinear it is defined as p1+a(p2-p1)+b(p3-p1) and lines l1->l2 is defined as l1(1-c)+l2•c where a, b, and c are numbers and in each dimension and as a whole that holds and setting them equal we can find intersect of line and point. For any polygon like this, find point in it, project a straight line to edges, z from begin to end on outer lines then z from those to inside point.

Also, point in 2d polygon is defined by from a start to an end, either it is clockwise or counterclockwise, find that by either outside or signed area. From that, find from a straight line through a point two closest on both sides. If rotationally possible and 2 sides then in, otherwise out. 2d line intersects are well known. With that, K-cluster and it is all planned. You are welcome to use this, make z buffer type 3+ dimensional, make spherical or hyperboloid 3+d. There is none now. Also, polygons are not self intersecting. X E.

Top comments (0)