3d drawing on screens, how to order drawn things?

All about geometry

3d drawing on screens, how to order drawn things?

Postby Guest » Wed Jun 12, 2024 3:50 pm

Simply put, how does draw order on a 2d surface using 3d points order what to draw? So there is view point, point at center of view plane, and x, y, and z dimensions defined and then there are points and shapes based on those points, how do I define which draws before another mathematically?

Like my algorithm so far is get 2d points which works, find which points are in rectangles of from minimum to maximum of all points 2d of other shape, project from smaller in other rectangle to larger on plane, smaller points from view point to plane with if no intersect then move on but if intersect then get a and distance of intersect, if failure to intersect try larger to smaller in other rectangle like smaller to larger, if either fails to find a closer distance or z try again with including points connected to a line with point inside other rectangle, also starting if all points are z before other then it is before and after all that check distance then z with only connected to in other rectangle then just check average z and distance, but how do I make it work?

That above does not work and I am trying for closest to reality I can get without having to go pixel by pixel or drastically slow a CPU, got any maybe inexact but close enough algorithm to determine whether one shape in a 3d space draws before another with above defined things before like my plan? I have checked math and intersect math is correct and so is in rectangles of each other, unsure about line part in rectangle, and I cannot find any open source or near enough online source for this, can anyone help me complex though this may be? I get parametric equation for projecting and it all looks correct to me but why would this not work? Everything online I can find says find intersection (that rectangles stuff), then find z, (tried z before distance too), then distance if not found that stuff and according to like my math research I got all that correct and yet why would it not work? I just know everything before calculus so might explain in numbers and equations, not matrices, can you? Also, I am doing this on a computer and it's sine, cosine, etc. is inaccurate so can I get a solution as exact as possible with that?
Guest
 

Re: 3d drawing on screens, how to order drawn things?

Postby Guest » Wed Jun 12, 2024 4:30 pm

t to multiply line by in parametric equation with P=point 0 on plane, Q=point 1, R=point 2, E=end point of line, S=view point maybe or maybe not, maybe.
(A(Ex-Sx)+B(Ey-Sy)+C(Ez-Sz))*t = -A(Sx-Px)-B(Sy-Py)-C(Sz-Pz)
A=(Qy-Py)x(Rz-Pz)-(Ry-Py)x(Qz-Pz)
B = -((Qx-Px)x(Rz-Pz)-(Rx-Px)x(Qz-Pz))
C=(Qx-Px)x(Ry-Py)-(Rx-Px)x(Qy-Py)

From there I use like x=view point x*(end x - view point x)*t to calculate line plane intersect, is all this correct?
https://m.youtube.com/watch?v=rL9UXzZYYo4
https://math.libretexts.org/Bookshelves ... _(Calculus)/Multivariable_Calculus/1%3A_Vectors_in_Space/Intersection_of_a_Line_and_a_Plane
Anything seem off?
Guest
 


Re: 3d drawing on screens, how to order drawn things?

Postby Guest » Wed Jun 12, 2024 7:06 pm

A(Px-Sx)-B(Py-Sy)+C(Pz-Sz)=(A(Ex-Sx)-B(Ey-Sy)+C(Ez-Sz))*t
I fixed this equation yet it still does not work maybe or maybe not, maybe.
Guest
 

Re: 3d drawing on screens, how to order drawn things?

Postby Guest » Thu Jun 13, 2024 11:26 am

Origin equation was correct but still not working maybe or maybe not, maybe.
Guest
 

Re: 3d drawing on screens, how to order drawn things?

Postby Guest » Sat Jun 15, 2024 10:00 am

Solved maybe or maybe not, maybe.
Guest
 


Return to Geometry



Who is online

Users browsing this forum: No registered users and 7 guests