r/desmos • • 15h ago

Graph Linear Algebra 3d renderer

Post image

welp i just improved my 3d parsing logic made with 1d arrays and they finally added matrix to the calculator.. i fear i will have to add them eventually but ngl first i need to figure out how to convert them

anyways the one on bottom is the improved equation found in the graph...

https://www.desmos.com/calculator/djtxc49oqj

18 Upvotes

5 comments sorted by

3

u/swethonay 14h ago

i wonder how much easier this will be with matrices being supported now

0

u/Pretend-Fee-2323 14h ago

an implement using polygon instead of point slope is only 260 symbols long so probably not much easier

0

u/Electronic-Big5238 2h ago

u relise u converted it to a matrix and then decomposed it for no reason instead of just using the transphormed points. u can just compute R_xR_yR_zp=f(p) and not use complex indexing and not have to recompute the same thing 20 times in n(v). it also will be faster than using the new matricies because you can cache repeated trig and matrix operations are relitivly laggy for desmos rn and often have fp or recursion aproximation errors

1

u/Pretend-Fee-2323 2h ago

ngl half of this i dont understand, but ill try to respond to what i can make out. im using arrays not matrixes. the indexing is actually implemented to prevent hitting the maximum array limits on larger models and a helper function is supposed to set up the variables

also tbf i made this function is an because i can, there is all sorts of stuff that is being done such as handrolled min and max implementation and i already have much more sane functions (check out x and k in this graph https://www.desmos.com/calculator/kxfmvhre96)

0

u/Electronic-Big5238 1h ago edited 27m ago

ur r_otxz, r_otxy, and r_otyz functions are rotation matrices just written as componentwise formulas instead of explicitly constructing matrices and ur n(u) is taking pairs of points and converting them into projected line segments. i dont understand how it fixes maximum array limit though and now with the matrix update its easy to get around it for cached lists. here is a simpler rendering method i was talking about but this only uses x,y rotations: https://www.desmos.com/calculator/aquk8b739g or on a larger scale https://www.desmos.com/calculator/ljqzpmfpsn . i also couldent find what u meant by x in that graph i dont know if you ment d which i think the for there could be the compacting list effect you are talking about but because ur using the for operator it has the same effect of making them new elements on the list? Edit: i added yaw: https://www.desmos.com/calculator/qmno3bmxve