• Tcl3d orthographic projection

    From Shaun Kulesa@21:1/5 to All on Sat Mar 11 14:32:59 2023
    Hello,

    I would like to use orthographic projection in my geometry shader. I am using the latest version of Tcl3d.

    How can I generate a orthographic projection in Tcl?

    Thanks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Obermeier@21:1/5 to All on Sun Mar 12 17:00:00 2023
    Am 11.03.2023 um 23:32 schrieb Shaun Kulesa:
    Hello,

    I would like to use orthographic projection in my geometry shader. I am using the latest version of Tcl3d.

    How can I generate a orthographic projection in Tcl?

    Thanks.

    Hi Shaun,

    See OpenGL functions glFrustum (perspective projection) vs. glOrtho (orthographic projection).
    There are also corresponding GLU functions gluPerspective vs gluOrto2D.

    For pure shader implementations there are tcl3dPerspective and tcl3dOrtho, which you can use to set
    the perspective matrix via glUniformMatrix4fv.
    See the Nopper demos for examples.

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Shaun Kulesa@21:1/5 to All on Sun Mar 12 11:49:58 2023
    Hello, thank you for giving me the names of the commands, I couldn't find these on the docs pdf I was looking at before.

    Now I have found a document which matches to your tcl3dOrtho function. https://www.tcl3d.org/download/tcl3d-0.5.0.distrib/Tcl3D-Manual-0.5.0.pdf

    For most of the functions on this document, the arguments are not provided. I have to give no arguments in my code so it tells me which order they go in as an error.
    Is there better documentation or is this the best there is?

    Thanks for your hard work to make the higher versions of OpenGL possible to use in Tcl.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Obermeier@21:1/5 to All on Sun Mar 12 21:59:03 2023
    Am 12.03.2023 um 19:49 schrieb Shaun Kulesa:
    Hello, thank you for giving me the names of the commands, I couldn't find these on the docs pdf I was looking at before.

    Now I have found a document which matches to your tcl3dOrtho function. https://www.tcl3d.org/download/tcl3d-0.5.0.distrib/Tcl3D-Manual-0.5.0.pdf

    For most of the functions on this document, the arguments are not provided. I have to give no arguments in my code so it tells me which order they go in as an error.
    Is there better documentation or is this the best there is?

    Thanks for your hard work to make the higher versions of OpenGL possible to use in Tcl.

    Although the Tcl3D manual is a little bit out-dated in some respects, the description of the Tcl wrapping in chapter 3 is still valid.
    So you have to look at the C definition of the OpenGL function you want to use and transform the functions parameters into the
    corresponding Tcl types. In most cases (having simple parameter types like ints or floats) this is quite straight-forward.

    There are also lots of Tcl3D scripts available as examples: https://www.tcl3d.org/demos.html

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Shaun Kulesa@21:1/5 to All on Tue Mar 14 13:02:54 2023
    Hello Paul,

    I have made a full quad renderer using the geometry shader but the quad does not want to display.
    I have looked through my code for the past hour to spot mistakes but I have not located any that I am aware of.

    I made the program a zip file, but I can't paste it in here so I will provide a google drive link.

    If you could look over it when you have some spare time I would appreciate it, it is only 97 lines and all the shaders should be 100% correct as I used them in a python project which works.

    https://drive.google.com/file/d/1kY1ILfce_BVsV1o1fhoYlffqlDzJlrsu/view?usp=sharing

    Thanks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Obermeier@21:1/5 to All on Wed Mar 15 17:40:30 2023
    Am 14.03.2023 um 21:02 schrieb Shaun Kulesa:
    Hello Paul,

    I have made a full quad renderer using the geometry shader but the quad does not want to display.
    I have looked through my code for the past hour to spot mistakes but I have not located any that I am aware of.

    I made the program a zip file, but I can't paste it in here so I will provide a google drive link.

    If you could look over it when you have some spare time I would appreciate it, it is only 97 lines and all the shaders should be 100% correct as I used them in a python project which works.

    https://drive.google.com/file/d/1kY1ILfce_BVsV1o1fhoYlffqlDzJlrsu/view?usp=sharing

    Thanks.

    Hi Shaun,

    you detected a wrapping error in glVertexAttribPointer.
    I work on a fix and will send it to you by private mail.

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Shaun Kulesa@21:1/5 to All on Wed Mar 15 11:08:33 2023
    Thank you, I really appreciate all your responses and help.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)