Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Rotate Text OpenGL

Rotate Text OpenGL

Scheduled Pinned Locked Moved C#
tutorialcsharpc++graphicsgame-dev
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paul Harsent
    wrote on last edited by
    #1

    Hi, I have been building a project in OpenGL, and the code to display text I have been using is

    Glut.glutBitmapCharacter()

    which cant be rotated. There are loads of tutorials out there for C and C++, but not for C#. Do anyone know how to rotate text in OpenGl, or a good step tutorial. This is the code class I used to render my text

    class String
    {
        public String()
        {
    
        }
    
        public void RenderString(double p\_x, double p\_y, string str, float rotateAngle)
        {
            float x = (float)p\_x;
            float y = (float)p\_y;
            Gl.glRasterPos2f(x, y);
            
            int len = str.Length;
    
            for (int i = 0; i < len; i++)
            {
                Gl.glClearColor(0, 0, 0, 0);
                Gl.glColor3f(0, 0, 0);
              
                Glut.glutBitmapCharacter(Glut.GLUT\_BITMAP\_HELVETICA\_18, str\[i\]);               
               
            }
        }
    
    }
    

    }

    N 1 Reply Last reply
    0
    • P Paul Harsent

      Hi, I have been building a project in OpenGL, and the code to display text I have been using is

      Glut.glutBitmapCharacter()

      which cant be rotated. There are loads of tutorials out there for C and C++, but not for C#. Do anyone know how to rotate text in OpenGl, or a good step tutorial. This is the code class I used to render my text

      class String
      {
          public String()
          {
      
          }
      
          public void RenderString(double p\_x, double p\_y, string str, float rotateAngle)
          {
              float x = (float)p\_x;
              float y = (float)p\_y;
              Gl.glRasterPos2f(x, y);
              
              int len = str.Length;
      
              for (int i = 0; i < len; i++)
              {
                  Gl.glClearColor(0, 0, 0, 0);
                  Gl.glColor3f(0, 0, 0);
                
                  Glut.glutBitmapCharacter(Glut.GLUT\_BITMAP\_HELVETICA\_18, str\[i\]);               
                 
              }
          }
      
      }
      

      }

      N Offline
      N Offline
      Natural_Demon
      wrote on last edited by
      #2

      why don't just use c++. you can included a c++ dll. but you also could download Nokia Qt C++. http://qt.nokia.com[^] download the creator + sdk bundle. there are many working opengl examples + code included. very very impressive examples. c++ is a faster than c# and THE choice for directX and OPENGL. there is also the TAO dll for c#, but it looks abandoned. c# is mainly for cheap office develpment, go c++ if you want speed. Nokia Qt rocks even better for office develpment, every control is opensource, it's easier to hook special needs. Qt includes a TimeLine class for special effects. Qt wil rule in the future. check for Kinetic scrolling tutorial. google earth is made with Qt and many other, like Adobe use Qt

      Bad = knowing 2 much

      modified on Tuesday, April 27, 2010 10:36 AM

      P 1 Reply Last reply
      0
      • N Natural_Demon

        why don't just use c++. you can included a c++ dll. but you also could download Nokia Qt C++. http://qt.nokia.com[^] download the creator + sdk bundle. there are many working opengl examples + code included. very very impressive examples. c++ is a faster than c# and THE choice for directX and OPENGL. there is also the TAO dll for c#, but it looks abandoned. c# is mainly for cheap office develpment, go c++ if you want speed. Nokia Qt rocks even better for office develpment, every control is opensource, it's easier to hook special needs. Qt includes a TimeLine class for special effects. Qt wil rule in the future. check for Kinetic scrolling tutorial. google earth is made with Qt and many other, like Adobe use Qt

        Bad = knowing 2 much

        modified on Tuesday, April 27, 2010 10:36 AM

        P Offline
        P Offline
        Paul Harsent
        wrote on last edited by
        #3

        I didnt know I could use c++.dll in C#, im writing it in C~ two reason one my C++ isnt good enough, and the program im writing this plug in for is writen in C#. Thanks very much will have a looked the links.

        N 1 Reply Last reply
        0
        • P Paul Harsent

          I didnt know I could use c++.dll in C#, im writing it in C~ two reason one my C++ isnt good enough, and the program im writing this plug in for is writen in C#. Thanks very much will have a looked the links.

          N Offline
          N Offline
          Natural_Demon
          wrote on last edited by
          #4

          there aint much too c++. the synthax is pretty simular, but you have to take care of cleaning recources used yourself. in c# you have the garbage handler, in c++ you don't. in c++ you would have to make a dispose methode pretty much everywhere and it looks very very simular too c# that's what makes c# the competitor of java. cheap develpment software. cheap ... because it needs less time and less acuracy to create something. you don't have to take care of freeing up recources that aren't used anymore, so you never really know if you software is actually 100%, because you don't need to think about it. if it wasn't for the 3rd party dll i use to connect to a virtual world. i wouldn't be using c# at all. translating this 3rd party dll into c++, would take me a year or so. but the downfall of DOTNET is ... you can easy reverse engineer your aplication and resell or hack it. with a simple click in a tool from the internet, you pretty much get the entire code. if you read about dotnet, you would have read the each executable actually transports the entire source and recompiles on the user machie. this is done by the JIT compiler. dotnet wil never be the tool by excellence for software venders. dotnet is used by people that didn't like the looks or feel of java, but also aren't competent or too lazy for c++. i don't live from coding, but this is what i learned in the last years. if my current project is done, i'm going Nokia Qt. power @ finger tips

          Bad = knowing 2 much

          D 1 Reply Last reply
          0
          • N Natural_Demon

            there aint much too c++. the synthax is pretty simular, but you have to take care of cleaning recources used yourself. in c# you have the garbage handler, in c++ you don't. in c++ you would have to make a dispose methode pretty much everywhere and it looks very very simular too c# that's what makes c# the competitor of java. cheap develpment software. cheap ... because it needs less time and less acuracy to create something. you don't have to take care of freeing up recources that aren't used anymore, so you never really know if you software is actually 100%, because you don't need to think about it. if it wasn't for the 3rd party dll i use to connect to a virtual world. i wouldn't be using c# at all. translating this 3rd party dll into c++, would take me a year or so. but the downfall of DOTNET is ... you can easy reverse engineer your aplication and resell or hack it. with a simple click in a tool from the internet, you pretty much get the entire code. if you read about dotnet, you would have read the each executable actually transports the entire source and recompiles on the user machie. this is done by the JIT compiler. dotnet wil never be the tool by excellence for software venders. dotnet is used by people that didn't like the looks or feel of java, but also aren't competent or too lazy for c++. i don't live from coding, but this is what i learned in the last years. if my current project is done, i'm going Nokia Qt. power @ finger tips

            Bad = knowing 2 much

            D Offline
            D Offline
            DaveyM69
            wrote on last edited by
            #5

            Natural_Demon wrote:

            dotnet is used by people that didn't like the looks or feel of java, but also aren't competent or too lazy for c++.

            I disagree! I'm not lazy and consider myself to be competent in many languages, but I use C# almost exclusively. The vast majority of the software I write is for use with bespoke in-house systems where security of source code is simply not an issue. I use C# because it enables me to quickly develop powerful applications and utilities as required in far less time than would be possible using C++.

            Dave

            If this helped, please vote & accept answer!

            Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
            BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

            N 1 Reply Last reply
            0
            • D DaveyM69

              Natural_Demon wrote:

              dotnet is used by people that didn't like the looks or feel of java, but also aren't competent or too lazy for c++.

              I disagree! I'm not lazy and consider myself to be competent in many languages, but I use C# almost exclusively. The vast majority of the software I write is for use with bespoke in-house systems where security of source code is simply not an issue. I use C# because it enables me to quickly develop powerful applications and utilities as required in far less time than would be possible using C++.

              Dave

              If this helped, please vote & accept answer!

              Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
              BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

              N Offline
              N Offline
              Natural_Demon
              wrote on last edited by
              #6

              bespoke in-house systems = cheap. 'quickly' develop powerful application = cheap. you boss or what ever pays less, becaue it takes less, right? so you do agree with me, be it in other words. regarding 'lazy' didn't count for all readers.

              Bad = knowing 2 much

              D 1 Reply Last reply
              0
              • N Natural_Demon

                bespoke in-house systems = cheap. 'quickly' develop powerful application = cheap. you boss or what ever pays less, becaue it takes less, right? so you do agree with me, be it in other words. regarding 'lazy' didn't count for all readers.

                Bad = knowing 2 much

                D Offline
                D Offline
                DaveyM69
                wrote on last edited by
                #7

                bespoke in-house systems != cheap; far from it. The cost of having a team of full time staff developing our systems is much greater than buying off the shelf stuff, and greater than having stuff written for us. It's worth while because: We can change requirements and make alterations when needed. The costs are constant - even if high. We have full control over every single line of code.

                Natural_Demon wrote:

                'quickly' develop powerful application = cheap.

                cheap == cost effective. Also, we add/create apps/utilities because we need them - that means we need them ASAP, not after a delay caused by a choice of language. Don't get me wrong, C/C++ has it's place but so does C#, and it's positives should never be viewed as derogatory to the language or it's users. If VB or Mickey Mouse for Windows did the job better for us then that's what we'd use. C# strikes the right balance for us in these situations, in others we do use other languages. :thumbsup:

                Dave

                If this helped, please vote & accept answer!

                Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
                BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups