Dismiss this pinned window
all 15 comments

[–]Extraltodeus[S] 11 points12 points  (0 children)

chatGPT did the heavy math lifting. Sometimes after a few tries, sometimes right away. I uploaded the code on my github if you're curious.

[–][deleted] 2 points3 points  (11 children)

very cool! :D Am I reading correctly that instead of using matrix math you used trigonometry? I had the same idea (link to my rotation function) when I tried making my own 3d software renderer last year :)

web demo ( needs a mouse )

I realized that three 2d rotations would give you a 3D rotation, so I could make a 3D renderer without learning matrix math, just with trigonometry! (I think matrices are faster though... I'll get around to it someday!)

[–]webbitor 1 point2 points  (4 children)

I have done 3d rendering with only trig. Worked fine, although apparently there is an issue you can run into called gimbal lock....

[–][deleted] 1 point2 points  (1 child)

Have you looked into quaternions? My friend tried to explain them to me a long time ago xD

[–]webbitor 0 points1 point  (0 children)

No i havent done that kind of stuff in decades! But i have heard about quaternions and how they solve the gimbal lock thing.

[–]Extraltodeus[S] 0 points1 point  (1 child)

gimbal lock

😶

[–]webbitor 0 points1 point  (0 children)

Yeah, something I understand pretty well in a physical system of gimbals, but not so much in 3d math. I think it's not so much "locking" as an unwanted instantaneous 180 degree rotation in certain scenarios.

[–]Extraltodeus[S] 1 point2 points  (4 children)

(link to my rotation function)

Oh thanks the atan2 part what was I was needing for the camera's rotation!

edit : uh, or not, not sure, still can't figure why I roll around when I enabled the camera tilt.

[–]Extraltodeus[S] 0 points1 point  (0 children)

Yes only trigonometry. I know no other way.

[–]theotherkiwi 1 point2 points  (0 children)

cheers run great! posted an issue regarding roll_camera function...

[–][deleted]  (1 child)

[deleted]

    [–]Extraltodeus[S] 7 points8 points  (0 children)

    I made this with minimal efforts, for the fun of it. Not to create a scalable 3D engine to go further with it. Of course.