#jogamp @ irc.freenode.net - 20170330 05:05:54 (UTC)


20170330 05:05:54 -jogamp- Previous @ http://jogamp.org/log/irc/jogamp_20170329050554.html
20170330 05:05:54 -jogamp- This channel is logged @ http://jogamp.org/log/irc/jogamp_20170330050554.html
20170330 06:59:03 <zubzub> Inf_: best is to learn some basic ogl before asking such questions: https://open.gl/introduction
20170330 07:19:37 <monsieur_max> the first triangle is the hardest one
20170330 07:22:57 <bruce-> yeah, that's especially true for GL >= 3 contexts
20170330 07:48:08 * monsieur_max (~maxime@anon) Quit (Ping timeout: 240 seconds)
20170330 07:49:43 * monsieur_max (~maxime@anon) has joined #jogamp
20170330 08:03:44 * elect_ (~elect@anon) has joined #jogamp
20170330 08:40:14 * hija1 (~petros@anon) has joined #jogamp
20170330 08:40:21 * hija1 (~petros@anon) Quit (Client Quit)
20170330 08:42:11 * hija1 (~petros@anon) has joined #jogamp
20170330 08:42:58 * hija (~petros@anon) Quit (Ping timeout: 264 seconds)
20170330 08:55:47 * jvanek (jvanek@anon) has joined #jogamp
20170330 09:28:51 * monsieur_max (~maxime@anon) Quit (Quit: Leaving.)
20170330 09:29:06 * monsieur_max (~maxime@anon) has joined #jogamp
20170330 10:42:15 * caelum19 (~Caelum@anon) has joined #jogamp
20170330 10:55:32 <xranby1> Inf_: OpenGL uses Cartesian coordinate system like in a math book 0,0,0 is lower left of the screen
20170330 10:56:34 <xranby1> arr
20170330 10:56:43 <xranby1> well i can be the center of the screen as well
20170330 10:57:35 <bruce-> :)
20170330 11:21:22 * hija1 (~petros@anon) Quit (Ping timeout: 264 seconds)
20170330 11:49:44 <Inf_> yes - i figured its thew center and i cant figure why; what i knew was that it was left bottom
20170330 11:55:12 <xranby1> Inf_: it depends how you have setup the viewport
20170330 11:56:06 <xranby1> and glOrtho
20170330 11:58:40 <Inf_> hmmm, can you write for me the two options please?
20170330 11:58:45 <Inf_> i wanna make sure i understand each
20170330 12:06:00 <xranby1> glViewport is the screen or window area in which to render to. thus if you prefer to render into a square in the middle of the window then do something like:
20170330 12:07:11 <xranby1> public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) {
20170330 12:07:11 <xranby1> System.out.println("Window resized to width=" + w + " height=" + h);
20170330 12:07:11 <xranby1> width = w;
20170330 12:07:11 <xranby1> height = h;
20170330 12:07:11 <xranby1> GL2ES2 gl = drawable.getGL().getGL2ES2();
20170330 12:07:12 <xranby1> // Render to a square at the center of the window.
20170330 12:07:12 <xranby1> gl.glViewport((width-height)/2,0,height,height);
20170330 12:07:13 <xranby1> }
20170330 12:07:42 <xranby1> you typically call glViewport on window resize
20170330 12:10:05 <xranby1> you can also use it to draw the same scene several times using different views like in a cad software.. then you change the viewport four times for each frame to render in each quadrant
20170330 12:14:21 <Inf_> ok
20170330 12:14:54 <Inf_> ill have to re-learn what quadrant is - isnt it like a list of shapes it gives an id and draws them as a collection?
20170330 12:15:29 <xranby1> glOrtho relates to how you setup the view that is it defines what your screen relates to in your 3d coordinates
20170330 12:15:42 <xranby1> by default opengl uses a default view
20170330 12:16:14 <xranby1> where 0,0 is in the middle of the camera
20170330 12:16:24 <xranby1> this default view can explicit be set like this
20170330 12:16:45 <xranby1> gl.glMatrixMode(gl.GL_PROJECTION); glLoadIdentity(); gl.glOrtho(-1, 1, -1, 1, -1, 1); gl.glMatrixMode(gl.GL_MODELVIEW);
20170330 12:17:57 <xranby1> however if you like origo to be placed somewhere else.. you can do it by changing the glOrtho
20170330 12:18:15 <Inf_> gl.glOrtho(-1, 1, -1, 1, -1, 1); this makes it bottom left of the window?
20170330 12:18:41 <xranby1> no it makes it in the center of the screen
20170330 12:21:34 <xranby1> to render in with origo in the lower left corner and pixel coordinates use gl.glOrtho(0, width, height, 0, 0, 1);
20170330 12:22:23 <xranby1> to render with origo in the top left with inverted coordinated then use gl.glOrtho(0, width, height, 0, 1, -1);
20170330 12:22:33 <xranby1> double check everything
20170330 12:26:33 <elect_> I have been reworking on a port tutorial of mine
20170330 12:26:43 <elect_> https://github.com/java-opengl-labs/modern-jogl-examples
20170330 12:27:01 <elect_> I consider the original one, one of the best out there
20170330 12:27:12 <elect_> it explain the graphic pipeline in detail
20170330 12:27:44 <elect_> if you are interested and make a big step up, take a look at the kotlin counterpart
20170330 12:28:02 * hija (~petros@anon) has joined #jogamp
20170330 12:28:04 <elect_> opengl made pleasant
20170330 12:30:27 * hija (~petros@anon) Quit (Client Quit)
20170330 12:42:20 <monsieur_max> elect_: http://www.javamagazine.mozaicreader.com/#&pageSet=4&page=0&contentItem=0
20170330 12:45:24 <elect_> interesting pov
20170330 12:45:40 <elect_> I'll share it
20170330 12:51:11 <monsieur_max> well, it doesn't go very deep, but there are a few things here and there that are interesting
20170330 13:20:21 * SHC (~quassel@anon) has joined #jogamp
20170330 14:20:16 * SHC (~quassel@anon) Quit (Remote host closed the connection)
20170330 14:28:28 <elect_> wanna see something else cool?
20170330 14:28:38 <elect_> / Check fail positive
20170330 14:28:39 <elect_> { shaderCodeOf(gl, this::class.java, data + "$FRAGMENT_FAIL.frag") } shallThrow GLException::class.java
20170330 14:29:06 <elect_> https://github.com/kotlin-graphics/uno-sdk/blob/master/src/main/kotlin/uno/kotlin/util.kt
20170330 15:15:58 <Inf_> xranby1: whats the full code to write when i want lower left corner and pixel coordinates?
20170330 15:16:13 <Inf_> gl.glLoadIdentity()? other stuff? whats the order?
20170330 15:17:16 <xranby1> gl.glMatrixMode(gl.GL_PROJECTION); glLoadIdentity(); gl.glOrtho(0, width, height, 0, 0, 1); gl.glMatrixMode(gl.GL_MODELVIEW);
20170330 15:17:25 <xranby1> try that
20170330 15:17:29 <xranby1> and report back if it work
20170330 15:22:04 <Inf_> ummm, it makes it top left
20170330 15:28:02 <Inf_> ok, i got it
20170330 15:28:38 <Inf_> void glOrtho(left, right, bottom, top, nearVal, farVal);
20170330 15:28:45 <Inf_> gl.glOrtho(0, width, 0, height, 0, 1);
20170330 15:29:40 * elect_ (~elect@anon) Quit (Ping timeout: 246 seconds)
20170330 15:52:01 * monsieur_max (~maxime@anon) Quit (Quit: Leaving.)
20170330 17:10:12 * jvanek (jvanek@anon) Quit (Remote host closed the connection)
20170330 18:08:15 * monsieur_max (~maxime@anon) has joined #jogamp
20170330 20:05:54 * monsieur_max (~maxime@anon) Quit (Quit: Leaving.)
20170330 20:15:42 * caelum191 (~Caelum@anon) has joined #jogamp
20170330 20:17:01 * caelum19 (~Caelum@anon) Quit (Ping timeout: 246 seconds)
20170330 20:22:13 * caelum19 (~Caelum@anon) has joined #jogamp
20170330 20:25:13 * caelum191 (~Caelum@anon) Quit (Ping timeout: 260 seconds)
20170330 20:27:35 * caelum191 (~Caelum@anon) has joined #jogamp
20170330 20:29:16 * caelum19 (~Caelum@anon) Quit (Ping timeout: 246 seconds)
20170330 22:43:57 * caelum191 (~Caelum@anon) Quit (Ping timeout: 240 seconds)
20170330 22:48:31 * caelum19 (~Caelum@anon) has joined #jogamp
20170330 22:48:52 * caelum191 (~Caelum@anon) has joined #jogamp
20170330 22:52:28 * caelum19 (~Caelum@anon) Quit (Ping timeout: 240 seconds)
20170330 23:24:58 * caelum19 (~Caelum@anon) has joined #jogamp
20170330 23:25:28 * caelum19 (~Caelum@anon) has left #jogamp
20170330 23:27:48 * caelum191 (~Caelum@anon) Quit (Ping timeout: 240 seconds)
20170330 23:41:11 * void256 (~chatzilla@anon) has joined #jogamp
20170330 23:51:25 * void256 (~chatzilla@anon) Quit (Quit: ChatZilla 0.9.93 [Firefox 52.0.2/20170323105023])
20170331 05:05:54 -jogamp- Continue @ http://jogamp.org/log/irc/jogamp_20170331050554.html