Show glutSolidCone on its sideWhy doesn't glCopyTexSubImage2D copy my square correctly?OpenGL texture mapping on sides cube using GL_QUADSOpenGL and GLUT uncomprehensionOpenGL/glut/stdc++ build errorsOpenGL object glossy/shiny in Mac OS X 10.6, but not 10.5. Why?PyOpenGL - passing transformation matrix into shaderMy display() function only displays when it enters it the first time. Then it shows a blank windowOpenGL Plane not showing upHaving many glut errorsCreating a 3D cube with 3 sides showing at run time, no rotation to see all 3 sides

What is the name of this Allen-head furniture fastener?

Ambiguity in notation resolved by +

POSIX compatible way to get user name associated with a user ID

Which is the current decimal separator?

How are aircraft depainted?

Telling my mother that I have anorexia without panicking her

How to give my students a straightedge instead of a ruler

Can I fix my boots by gluing the soles back on?

Amortized Loans seem to benefit the bank more than the customer

What are these things that surround museum exhibits called?

The Planck constant for mathematicians

Is there a tool to measure the "maturity" of a code in Git?

Is there any benefit to riders on the front of a paceline?

New default file type?

How to write characters doing illogical things in a believable way?

Can I see Harvest moon in India?

Why the car dealer is insisting on loan instead of cash

What 68-pin connector is this on my 2.5" solid state drive?

Some Prime Peerage

ColorFunction based on array index in ListLinePlot

What exactly is a marshrutka (маршрутка)?

Why does the speed of sound decrease at high altitudes although the air density decreases?

Bit one of the Intel 8080's Flags register

How would you control supersoldiers in a late iron-age society?



Show glutSolidCone on its side


Why doesn't glCopyTexSubImage2D copy my square correctly?OpenGL texture mapping on sides cube using GL_QUADSOpenGL and GLUT uncomprehensionOpenGL/glut/stdc++ build errorsOpenGL object glossy/shiny in Mac OS X 10.6, but not 10.5. Why?PyOpenGL - passing transformation matrix into shaderMy display() function only displays when it enters it the first time. Then it shows a blank windowOpenGL Plane not showing upHaving many glut errorsCreating a 3D cube with 3 sides showing at run time, no rotation to see all 3 sides






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I am trying to look at a cone lying on its side from above. For this I wrote the following code:



void display(void)

glClear(GL_COLOR_BUFFER_BIT

int main(int argc, char **argv)
GLUT_DOUBLE


I translate to the middle of the screen and then rotate 90 degrees around the x-axis, which in my idea should produce the cone on its side. The result however is a not a cone but a line which is not tilted 90 but 45 degrees. What should I change in order for the cone to show up as I want it to?










share|improve this question
































    1















    I am trying to look at a cone lying on its side from above. For this I wrote the following code:



    void display(void)

    glClear(GL_COLOR_BUFFER_BIT

    int main(int argc, char **argv)
    GLUT_DOUBLE


    I translate to the middle of the screen and then rotate 90 degrees around the x-axis, which in my idea should produce the cone on its side. The result however is a not a cone but a line which is not tilted 90 but 45 degrees. What should I change in order for the cone to show up as I want it to?










    share|improve this question




























      1












      1








      1








      I am trying to look at a cone lying on its side from above. For this I wrote the following code:



      void display(void)

      glClear(GL_COLOR_BUFFER_BIT

      int main(int argc, char **argv)
      GLUT_DOUBLE


      I translate to the middle of the screen and then rotate 90 degrees around the x-axis, which in my idea should produce the cone on its side. The result however is a not a cone but a line which is not tilted 90 but 45 degrees. What should I change in order for the cone to show up as I want it to?










      share|improve this question
















      I am trying to look at a cone lying on its side from above. For this I wrote the following code:



      void display(void)

      glClear(GL_COLOR_BUFFER_BIT

      int main(int argc, char **argv)
      GLUT_DOUBLE


      I translate to the middle of the screen and then rotate 90 degrees around the x-axis, which in my idea should produce the cone on its side. The result however is a not a cone but a line which is not tilted 90 but 45 degrees. What should I change in order for the cone to show up as I want it to?







      c++ opengl glut opengl-compat






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 28 at 13:37









      Nicol Bolas

      308k38 gold badges516 silver badges700 bronze badges




      308k38 gold badges516 silver badges700 bronze badges










      asked Mar 28 at 11:21









      LarsLars

      325 bronze badges




      325 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          2
















          Where is the projection matrix?



          If you don't set a projection matrix, then the coordiantes have to be set in normalize device space. In NDC all the coordinates are in range [-1.0, 1.0]:



          e.g.



          glMatrixMode(GL_MODELVIEW);
          glLoadIdentity();

          glTranslatef(0.5, 0.5, 0);
          glRotatef(90, 1, 0, 0);
          glutSolidCone(1.0, 1.0, 20, 20);
          glTranslatef(-0.5, -0.5, 0);
          glRotatef(-90, 1, 0, 0);



          Alternatively you can setup an orthographic projection, which projects the world coordinates 1:1 to the window coordinates. The projection matrix can be set by glOrtho:



          e.g.



          void display(void)

          glClear(GL_COLOR_BUFFER_BIT


          The projection matrix describes the mapping from 3D points of the view on a scene, to 2D points on the viewport. At Orthographic Projection, the view space coordinates are linearly mapped to the clip space coordinates. The clip space coordinates are equal to the normalized device coordinates.

          The normalized device coordinates are linearly mapped to the viewport rectangle.
          The viewport rectangle can be defined by glViewport. Initially it is defined by the size of the window.




          Note, that drawing by glBegin/glEnd sequences and the fixed function matrix stack is deprecated since decades. See Fixed Function Pipeline and Legacy OpenGL.
          Read about Vertex Specification and Shader for a state of the art way of rendering.






          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/4.0/"u003ecc by-sa 4.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%2f55396335%2fshow-glutsolidcone-on-its-side%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2
















            Where is the projection matrix?



            If you don't set a projection matrix, then the coordiantes have to be set in normalize device space. In NDC all the coordinates are in range [-1.0, 1.0]:



            e.g.



            glMatrixMode(GL_MODELVIEW);
            glLoadIdentity();

            glTranslatef(0.5, 0.5, 0);
            glRotatef(90, 1, 0, 0);
            glutSolidCone(1.0, 1.0, 20, 20);
            glTranslatef(-0.5, -0.5, 0);
            glRotatef(-90, 1, 0, 0);



            Alternatively you can setup an orthographic projection, which projects the world coordinates 1:1 to the window coordinates. The projection matrix can be set by glOrtho:



            e.g.



            void display(void)

            glClear(GL_COLOR_BUFFER_BIT


            The projection matrix describes the mapping from 3D points of the view on a scene, to 2D points on the viewport. At Orthographic Projection, the view space coordinates are linearly mapped to the clip space coordinates. The clip space coordinates are equal to the normalized device coordinates.

            The normalized device coordinates are linearly mapped to the viewport rectangle.
            The viewport rectangle can be defined by glViewport. Initially it is defined by the size of the window.




            Note, that drawing by glBegin/glEnd sequences and the fixed function matrix stack is deprecated since decades. See Fixed Function Pipeline and Legacy OpenGL.
            Read about Vertex Specification and Shader for a state of the art way of rendering.






            share|improve this answer































              2
















              Where is the projection matrix?



              If you don't set a projection matrix, then the coordiantes have to be set in normalize device space. In NDC all the coordinates are in range [-1.0, 1.0]:



              e.g.



              glMatrixMode(GL_MODELVIEW);
              glLoadIdentity();

              glTranslatef(0.5, 0.5, 0);
              glRotatef(90, 1, 0, 0);
              glutSolidCone(1.0, 1.0, 20, 20);
              glTranslatef(-0.5, -0.5, 0);
              glRotatef(-90, 1, 0, 0);



              Alternatively you can setup an orthographic projection, which projects the world coordinates 1:1 to the window coordinates. The projection matrix can be set by glOrtho:



              e.g.



              void display(void)

              glClear(GL_COLOR_BUFFER_BIT


              The projection matrix describes the mapping from 3D points of the view on a scene, to 2D points on the viewport. At Orthographic Projection, the view space coordinates are linearly mapped to the clip space coordinates. The clip space coordinates are equal to the normalized device coordinates.

              The normalized device coordinates are linearly mapped to the viewport rectangle.
              The viewport rectangle can be defined by glViewport. Initially it is defined by the size of the window.




              Note, that drawing by glBegin/glEnd sequences and the fixed function matrix stack is deprecated since decades. See Fixed Function Pipeline and Legacy OpenGL.
              Read about Vertex Specification and Shader for a state of the art way of rendering.






              share|improve this answer





























                2














                2










                2









                Where is the projection matrix?



                If you don't set a projection matrix, then the coordiantes have to be set in normalize device space. In NDC all the coordinates are in range [-1.0, 1.0]:



                e.g.



                glMatrixMode(GL_MODELVIEW);
                glLoadIdentity();

                glTranslatef(0.5, 0.5, 0);
                glRotatef(90, 1, 0, 0);
                glutSolidCone(1.0, 1.0, 20, 20);
                glTranslatef(-0.5, -0.5, 0);
                glRotatef(-90, 1, 0, 0);



                Alternatively you can setup an orthographic projection, which projects the world coordinates 1:1 to the window coordinates. The projection matrix can be set by glOrtho:



                e.g.



                void display(void)

                glClear(GL_COLOR_BUFFER_BIT


                The projection matrix describes the mapping from 3D points of the view on a scene, to 2D points on the viewport. At Orthographic Projection, the view space coordinates are linearly mapped to the clip space coordinates. The clip space coordinates are equal to the normalized device coordinates.

                The normalized device coordinates are linearly mapped to the viewport rectangle.
                The viewport rectangle can be defined by glViewport. Initially it is defined by the size of the window.




                Note, that drawing by glBegin/glEnd sequences and the fixed function matrix stack is deprecated since decades. See Fixed Function Pipeline and Legacy OpenGL.
                Read about Vertex Specification and Shader for a state of the art way of rendering.






                share|improve this answer















                Where is the projection matrix?



                If you don't set a projection matrix, then the coordiantes have to be set in normalize device space. In NDC all the coordinates are in range [-1.0, 1.0]:



                e.g.



                glMatrixMode(GL_MODELVIEW);
                glLoadIdentity();

                glTranslatef(0.5, 0.5, 0);
                glRotatef(90, 1, 0, 0);
                glutSolidCone(1.0, 1.0, 20, 20);
                glTranslatef(-0.5, -0.5, 0);
                glRotatef(-90, 1, 0, 0);



                Alternatively you can setup an orthographic projection, which projects the world coordinates 1:1 to the window coordinates. The projection matrix can be set by glOrtho:



                e.g.



                void display(void)

                glClear(GL_COLOR_BUFFER_BIT


                The projection matrix describes the mapping from 3D points of the view on a scene, to 2D points on the viewport. At Orthographic Projection, the view space coordinates are linearly mapped to the clip space coordinates. The clip space coordinates are equal to the normalized device coordinates.

                The normalized device coordinates are linearly mapped to the viewport rectangle.
                The viewport rectangle can be defined by glViewport. Initially it is defined by the size of the window.




                Note, that drawing by glBegin/glEnd sequences and the fixed function matrix stack is deprecated since decades. See Fixed Function Pipeline and Legacy OpenGL.
                Read about Vertex Specification and Shader for a state of the art way of rendering.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 28 at 11:39

























                answered Mar 28 at 11:34









                Rabbid76Rabbid76

                60k13 gold badges39 silver badges71 bronze badges




                60k13 gold badges39 silver badges71 bronze badges





















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.




















                    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%2f55396335%2fshow-glutsolidcone-on-its-side%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 preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

                    155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

                    Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?