Sign in to follow this  

Mirroring bitmap

This topic is 4687 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Quote:
Original post by Fruny
Hmm... Off-hand, you could probably do a glScalef(-1.0f, 1.0f, 1.0f); ...


If you were mirroring, I thought it would be glScalef(1.0f, -1.0f, 1.0f); If you negate the X value then it will flip it over the X-Axis. Anyways I do not think that is possible in that tutorial because it uses glRasterPos2f. You are doing 2D of which I do not know off the top of my head how you could mirror it short of flipping the camera.

- Drew

Share this post


Link to post
Share on other sites
Quote:
Original post by Drew_Benton
If you were mirroring, I thought it would be glScalef(1.0f, -1.0f, 1.0f); If you negate the X value then it will flip it over the X-Axis.


No, it will flip the X axis. Which is a reflection over the YZ plane.

Quote:
Anyways I do not think that is possible in that tutorial because it uses glRasterPos2f.


You may have to adjust the raster position, but I believe the textures (i.e. the text) will be mirrored.

Quote:
You are doing 2D of which I do not know off the top of my head how you could mirror it short of flipping the camera.


Which is what glScale does.

Share this post


Link to post
Share on other sites
Hmm intresting. I do not know if it is just the tutorial then. I downloaded it and tried the methods you suggested as well as mine, and I was not able to get it to work correctly. It seems that none of the functions are working corectly. I tried to scale down and up but the text is the same, same goes for rotate as well. I do not know if I am doing somting wrong though, but I tried this stuff in multiple locations including in the list generation. That's what prompted me to make the suggest about the glRasterPos2f.

Lesson 13 op? I did not see anything to do with bitmaps. It says 'OpenGL Lesson 13: Using Bitmap Fonts' but it uses windows font files in 2D. Appologies to Fruny for his method should work IIRC in 3D. If you use lesson 14 or 15, then maybe you will be able to mirror the font. I don't know [lol] I give up. I'll find a different tutorial that shows it. I'll see about that mirroring as well..

- Drew

Share this post


Link to post
Share on other sites
Ok OP here's the deal. In that lesson you cannot do what you want to do because it is using Raster2D. However, if you use the next tutorial, you can modify the draw function to look like this, to get the exact same thing.



int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer
glLoadIdentity(); // Reset The Current Modelview Matrix
glTranslatef(0.0f,0.0f,-10.0f); // Move One Unit Into The Screen
glScalef(-1,1,1);
glColor3f(1.0f*float(cos(rot/20.0f)),1.0f*float(sin(rot/25.0f)),1.0f-0.5f*float(cos(rot/17.0f)));
glPrint("NeHe - %3.2f",rot/50); // Print GL Text To The Screen
rot+=0.5f; // Increase The Rotation Variable
return TRUE; // Everything Went OK
}




BTW Frunny was right with the "glScalef(-1,1,1);" [smile]

- Drew

Share this post


Link to post
Share on other sites

This topic is 4687 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this