What is the purpose of glTranslatef() method?












-2















I am quite a beginner in openGl. Can you please tell me about



glTranslatef();  
glScalef();
glBegin ();


I have searched for them in google but couldn't get the answer.



Thankyou










share|improve this question





























    -2















    I am quite a beginner in openGl. Can you please tell me about



    glTranslatef();  
    glScalef();
    glBegin ();


    I have searched for them in google but couldn't get the answer.



    Thankyou










    share|improve this question



























      -2












      -2








      -2








      I am quite a beginner in openGl. Can you please tell me about



      glTranslatef();  
      glScalef();
      glBegin ();


      I have searched for them in google but couldn't get the answer.



      Thankyou










      share|improve this question
















      I am quite a beginner in openGl. Can you please tell me about



      glTranslatef();  
      glScalef();
      glBegin ();


      I have searched for them in google but couldn't get the answer.



      Thankyou







      opengl






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 '18 at 9:25









      JeJo

      4,5073726




      4,5073726










      asked Dec 27 '15 at 13:17









      IonyIony

      7817




      7817
























          2 Answers
          2






          active

          oldest

          votes


















          8
















          • glTranslate produces a translation by x y z . The current matrix (see glMatrixMode) is multiplied by this translation matrix,
            with the product replacing the current matrix, as if glMultMatrix
            were called with the following matrix for its argument:



            1 0 0 x 
            0 1 0 y
            0 0 1 z
            0 0 0 1


            If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all
            objects drawn after a call to glTranslate are translated.



            Use glPushMatrix and glPopMatrix to save and restore the
            untranslated coordinate system.



            More information about glTranslate




          • glScale produces a nonuniform scaling along the x, y, and z axes. The three parameters indicate the desired scale factor along each of
            the three axes.



            The current matrix (see glMatrixMode) is multiplied by this
            scale matrix, and the product replaces the current matrix as if
            glMultMatrix were called with the following matrix as its argument:



            x 0 0 0 
            0 y 0 0
            0 0 z 0
            0 0 0 1


            If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all
            objects drawn after glScale is called are scaled.



            Use glPushMatrix and glPopMatrix to save and restore the unscaled
            coordinate system.



            More information about glScale




          • glBegin and glEnd delimit the vertices that define a primitive or a group of like primitives. glBegin accepts a single
            argument that specifies in which of ten ways the vertices are
            interpreted. Taking n as an integer count starting at one, and N as
            the total number of vertices specified.



            More information on glBegin








          share|improve this answer


























          • if we use glTranslatef(); and glScalef(); together what effect will be taken plece

            – Iony
            Dec 27 '15 at 13:35











          • I am extremely new.. please help me

            – Iony
            Dec 27 '15 at 13:35











          • glTranslate get the position of the objects just like ex-glTranslatef(1,1,2); and glScalef() scale it as multiply the current matrix by a general scaling matrix.like this glscalef(10,10,10)

            – AVI
            Dec 27 '15 at 13:51













          • Scale, just like Rotate, operates from the origin and important thing is Don't forget to use transformations in the required order

            – AVI
            Dec 27 '15 at 13:59



















          1














          DoughnutZombie - has given the valid & correct answer.



          but, in simple terms, IIRC you can think of them a little like:




          • glTranslate lets you "move" things

          • glScale is to scale them

          • and glBegin to let opengl know you are about to give something, like a list of vertices to draw a triangle


          You will indeed need to use pushmatrix and popmatrix



          All of these should be covered in most newcomers tutorials, may I recommend the legacy tutorials at http://nehe.gamedev.net/






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f34480765%2fwhat-is-the-purpose-of-gltranslatef-method%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            8
















            • glTranslate produces a translation by x y z . The current matrix (see glMatrixMode) is multiplied by this translation matrix,
              with the product replacing the current matrix, as if glMultMatrix
              were called with the following matrix for its argument:



              1 0 0 x 
              0 1 0 y
              0 0 1 z
              0 0 0 1


              If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all
              objects drawn after a call to glTranslate are translated.



              Use glPushMatrix and glPopMatrix to save and restore the
              untranslated coordinate system.



              More information about glTranslate




            • glScale produces a nonuniform scaling along the x, y, and z axes. The three parameters indicate the desired scale factor along each of
              the three axes.



              The current matrix (see glMatrixMode) is multiplied by this
              scale matrix, and the product replaces the current matrix as if
              glMultMatrix were called with the following matrix as its argument:



              x 0 0 0 
              0 y 0 0
              0 0 z 0
              0 0 0 1


              If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all
              objects drawn after glScale is called are scaled.



              Use glPushMatrix and glPopMatrix to save and restore the unscaled
              coordinate system.



              More information about glScale




            • glBegin and glEnd delimit the vertices that define a primitive or a group of like primitives. glBegin accepts a single
              argument that specifies in which of ten ways the vertices are
              interpreted. Taking n as an integer count starting at one, and N as
              the total number of vertices specified.



              More information on glBegin








            share|improve this answer


























            • if we use glTranslatef(); and glScalef(); together what effect will be taken plece

              – Iony
              Dec 27 '15 at 13:35











            • I am extremely new.. please help me

              – Iony
              Dec 27 '15 at 13:35











            • glTranslate get the position of the objects just like ex-glTranslatef(1,1,2); and glScalef() scale it as multiply the current matrix by a general scaling matrix.like this glscalef(10,10,10)

              – AVI
              Dec 27 '15 at 13:51













            • Scale, just like Rotate, operates from the origin and important thing is Don't forget to use transformations in the required order

              – AVI
              Dec 27 '15 at 13:59
















            8
















            • glTranslate produces a translation by x y z . The current matrix (see glMatrixMode) is multiplied by this translation matrix,
              with the product replacing the current matrix, as if glMultMatrix
              were called with the following matrix for its argument:



              1 0 0 x 
              0 1 0 y
              0 0 1 z
              0 0 0 1


              If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all
              objects drawn after a call to glTranslate are translated.



              Use glPushMatrix and glPopMatrix to save and restore the
              untranslated coordinate system.



              More information about glTranslate




            • glScale produces a nonuniform scaling along the x, y, and z axes. The three parameters indicate the desired scale factor along each of
              the three axes.



              The current matrix (see glMatrixMode) is multiplied by this
              scale matrix, and the product replaces the current matrix as if
              glMultMatrix were called with the following matrix as its argument:



              x 0 0 0 
              0 y 0 0
              0 0 z 0
              0 0 0 1


              If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all
              objects drawn after glScale is called are scaled.



              Use glPushMatrix and glPopMatrix to save and restore the unscaled
              coordinate system.



              More information about glScale




            • glBegin and glEnd delimit the vertices that define a primitive or a group of like primitives. glBegin accepts a single
              argument that specifies in which of ten ways the vertices are
              interpreted. Taking n as an integer count starting at one, and N as
              the total number of vertices specified.



              More information on glBegin








            share|improve this answer


























            • if we use glTranslatef(); and glScalef(); together what effect will be taken plece

              – Iony
              Dec 27 '15 at 13:35











            • I am extremely new.. please help me

              – Iony
              Dec 27 '15 at 13:35











            • glTranslate get the position of the objects just like ex-glTranslatef(1,1,2); and glScalef() scale it as multiply the current matrix by a general scaling matrix.like this glscalef(10,10,10)

              – AVI
              Dec 27 '15 at 13:51













            • Scale, just like Rotate, operates from the origin and important thing is Don't forget to use transformations in the required order

              – AVI
              Dec 27 '15 at 13:59














            8












            8








            8









            • glTranslate produces a translation by x y z . The current matrix (see glMatrixMode) is multiplied by this translation matrix,
              with the product replacing the current matrix, as if glMultMatrix
              were called with the following matrix for its argument:



              1 0 0 x 
              0 1 0 y
              0 0 1 z
              0 0 0 1


              If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all
              objects drawn after a call to glTranslate are translated.



              Use glPushMatrix and glPopMatrix to save and restore the
              untranslated coordinate system.



              More information about glTranslate




            • glScale produces a nonuniform scaling along the x, y, and z axes. The three parameters indicate the desired scale factor along each of
              the three axes.



              The current matrix (see glMatrixMode) is multiplied by this
              scale matrix, and the product replaces the current matrix as if
              glMultMatrix were called with the following matrix as its argument:



              x 0 0 0 
              0 y 0 0
              0 0 z 0
              0 0 0 1


              If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all
              objects drawn after glScale is called are scaled.



              Use glPushMatrix and glPopMatrix to save and restore the unscaled
              coordinate system.



              More information about glScale




            • glBegin and glEnd delimit the vertices that define a primitive or a group of like primitives. glBegin accepts a single
              argument that specifies in which of ten ways the vertices are
              interpreted. Taking n as an integer count starting at one, and N as
              the total number of vertices specified.



              More information on glBegin








            share|improve this answer

















            • glTranslate produces a translation by x y z . The current matrix (see glMatrixMode) is multiplied by this translation matrix,
              with the product replacing the current matrix, as if glMultMatrix
              were called with the following matrix for its argument:



              1 0 0 x 
              0 1 0 y
              0 0 1 z
              0 0 0 1


              If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all
              objects drawn after a call to glTranslate are translated.



              Use glPushMatrix and glPopMatrix to save and restore the
              untranslated coordinate system.



              More information about glTranslate




            • glScale produces a nonuniform scaling along the x, y, and z axes. The three parameters indicate the desired scale factor along each of
              the three axes.



              The current matrix (see glMatrixMode) is multiplied by this
              scale matrix, and the product replaces the current matrix as if
              glMultMatrix were called with the following matrix as its argument:



              x 0 0 0 
              0 y 0 0
              0 0 z 0
              0 0 0 1


              If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all
              objects drawn after glScale is called are scaled.



              Use glPushMatrix and glPopMatrix to save and restore the unscaled
              coordinate system.



              More information about glScale




            • glBegin and glEnd delimit the vertices that define a primitive or a group of like primitives. glBegin accepts a single
              argument that specifies in which of ten ways the vertices are
              interpreted. Taking n as an integer count starting at one, and N as
              the total number of vertices specified.



              More information on glBegin









            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited May 19 '18 at 22:51









            AbcAeffchen

            8,685123553




            8,685123553










            answered Dec 27 '15 at 13:26









            AVIAVI

            4,41152233




            4,41152233













            • if we use glTranslatef(); and glScalef(); together what effect will be taken plece

              – Iony
              Dec 27 '15 at 13:35











            • I am extremely new.. please help me

              – Iony
              Dec 27 '15 at 13:35











            • glTranslate get the position of the objects just like ex-glTranslatef(1,1,2); and glScalef() scale it as multiply the current matrix by a general scaling matrix.like this glscalef(10,10,10)

              – AVI
              Dec 27 '15 at 13:51













            • Scale, just like Rotate, operates from the origin and important thing is Don't forget to use transformations in the required order

              – AVI
              Dec 27 '15 at 13:59



















            • if we use glTranslatef(); and glScalef(); together what effect will be taken plece

              – Iony
              Dec 27 '15 at 13:35











            • I am extremely new.. please help me

              – Iony
              Dec 27 '15 at 13:35











            • glTranslate get the position of the objects just like ex-glTranslatef(1,1,2); and glScalef() scale it as multiply the current matrix by a general scaling matrix.like this glscalef(10,10,10)

              – AVI
              Dec 27 '15 at 13:51













            • Scale, just like Rotate, operates from the origin and important thing is Don't forget to use transformations in the required order

              – AVI
              Dec 27 '15 at 13:59

















            if we use glTranslatef(); and glScalef(); together what effect will be taken plece

            – Iony
            Dec 27 '15 at 13:35





            if we use glTranslatef(); and glScalef(); together what effect will be taken plece

            – Iony
            Dec 27 '15 at 13:35













            I am extremely new.. please help me

            – Iony
            Dec 27 '15 at 13:35





            I am extremely new.. please help me

            – Iony
            Dec 27 '15 at 13:35













            glTranslate get the position of the objects just like ex-glTranslatef(1,1,2); and glScalef() scale it as multiply the current matrix by a general scaling matrix.like this glscalef(10,10,10)

            – AVI
            Dec 27 '15 at 13:51







            glTranslate get the position of the objects just like ex-glTranslatef(1,1,2); and glScalef() scale it as multiply the current matrix by a general scaling matrix.like this glscalef(10,10,10)

            – AVI
            Dec 27 '15 at 13:51















            Scale, just like Rotate, operates from the origin and important thing is Don't forget to use transformations in the required order

            – AVI
            Dec 27 '15 at 13:59





            Scale, just like Rotate, operates from the origin and important thing is Don't forget to use transformations in the required order

            – AVI
            Dec 27 '15 at 13:59













            1














            DoughnutZombie - has given the valid & correct answer.



            but, in simple terms, IIRC you can think of them a little like:




            • glTranslate lets you "move" things

            • glScale is to scale them

            • and glBegin to let opengl know you are about to give something, like a list of vertices to draw a triangle


            You will indeed need to use pushmatrix and popmatrix



            All of these should be covered in most newcomers tutorials, may I recommend the legacy tutorials at http://nehe.gamedev.net/






            share|improve this answer




























              1














              DoughnutZombie - has given the valid & correct answer.



              but, in simple terms, IIRC you can think of them a little like:




              • glTranslate lets you "move" things

              • glScale is to scale them

              • and glBegin to let opengl know you are about to give something, like a list of vertices to draw a triangle


              You will indeed need to use pushmatrix and popmatrix



              All of these should be covered in most newcomers tutorials, may I recommend the legacy tutorials at http://nehe.gamedev.net/






              share|improve this answer


























                1












                1








                1







                DoughnutZombie - has given the valid & correct answer.



                but, in simple terms, IIRC you can think of them a little like:




                • glTranslate lets you "move" things

                • glScale is to scale them

                • and glBegin to let opengl know you are about to give something, like a list of vertices to draw a triangle


                You will indeed need to use pushmatrix and popmatrix



                All of these should be covered in most newcomers tutorials, may I recommend the legacy tutorials at http://nehe.gamedev.net/






                share|improve this answer













                DoughnutZombie - has given the valid & correct answer.



                but, in simple terms, IIRC you can think of them a little like:




                • glTranslate lets you "move" things

                • glScale is to scale them

                • and glBegin to let opengl know you are about to give something, like a list of vertices to draw a triangle


                You will indeed need to use pushmatrix and popmatrix



                All of these should be covered in most newcomers tutorials, may I recommend the legacy tutorials at http://nehe.gamedev.net/







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 27 '15 at 13:38









                ChozabuChozabu

                6461728




                6461728






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f34480765%2fwhat-is-the-purpose-of-gltranslatef-method%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to change which sound is reproduced for terminal bell?

                    Can I use Tabulator js library in my java Spring + Thymeleaf project?

                    Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents