OpenGL Discussion and Help Forums - Math and Algorithms
https://www.opengl.org/discussion_boards/
Discussion about 3D math and linear algebra that is essential as a background to OpenGL codingenThu, 26 Apr 2018 16:56:00 GMTvBulletin60https://www.opengl.org/discussion_boards/images/misc/rss.pngOpenGL Discussion and Help Forums - Math and Algorithms
https://www.opengl.org/discussion_boards/
Screen Position Calculations - Help Needed
https://www.opengl.org/discussion_boards/showthread.php/200582-Screen-Position-Calculations-Help-Needed?goto=newpost
Sat, 07 Apr 2018 15:52:36 GMTHello guys,

I've got three values (angles) - x and y that camera is facing (yaw and pitch, and z if needed), these are:

x - heading from true north in OGL coordinates
y - pitch from flat in OGL coordinates

I am wondering if it is possible by using these values to get Screen Position as a vector of xy?

Also, if we have a pitch value from flat Surface, would it be possible to recalculate pitch if camera moves up? If yes, how?

Sorry for asking for help but I am new to OpenGL and desperatly in need of advice.

Best Regards,
Michal
]]>Math and Algorithmslogitech334https://www.opengl.org/discussion_boards/showthread.php/200582-Screen-Position-Calculations-Help-NeededUnpacking ternary digits
https://www.opengl.org/discussion_boards/showthread.php/200564-Unpacking-ternary-digits?goto=newpost
Sun, 01 Apr 2018 15:56:48 GMTI have a shader which needs a map which includes ternary digits (i.e. value can be 0, 1, 2), aka trits.
I know this can be (fairly) efficiently...I have a shader which needs a map which includes ternary digits (i.e. value can be 0, 1, 2), aka trits.

I know this can be (fairly) efficiently packed at five trits ber byte (since 3 to power 5 = 243).

What is the most efficient way to unpack these in shader code? Or is unpacking so slow that I would be better storing 4 trits per byte and living with the increased memory requirements? (I know ASTC compression uses this packing, but that's being done in hardware not shader.)

I also want to know how to efficiently unpack quints (base 5 digits) stored at 3 per 7 bits (5 * 5 * 5 = 125) ... and storing only 2 quints per byte would be really inefficient.

Thanks
]]>Math and Algorithmsbarneypitthttps://www.opengl.org/discussion_boards/showthread.php/200564-Unpacking-ternary-digitsHow much is 1 distance unit.
https://www.opengl.org/discussion_boards/showthread.php/200561-How-much-is-1-distance-unit?goto=newpost
Sat, 31 Mar 2018 10:57:24 GMTHello, I'm learning OpenGL here: https://learnopengl.com/Introduction
I'm trying to write light 3D library. Similar to SFML, but with one more Dimension.

I wanted to change those OpenGL' unity (normalized) to pixels. https://pastebin.com/riBk6ZKy
This is how I'm setting vertices. I'm wondering, depending on my Projection, how much is one Unit?
My viewport is 0, 0, 1280, 720.
FOV is 45 degree.
]]>Math and AlgorithmsKnayderhttps://www.opengl.org/discussion_boards/showthread.php/200561-How-much-is-1-distance-unit