Sign in to follow this  
MadsGustaf

Lesson #9

Recommended Posts

Hello :) Thanks allot for making these great OpenGL tutorials public available! I have two questions about Lesson #9. (1)Where exactly are you extracting the black pixels from the gray scale image? I'm probably missing something out, because i can see it working, but i can not seem to figure out where [in the code], and how it is done. Also a suggestion: I think you should add a a brief explanation of the difference between "translation before rotation", and "rotation before translation". I know it is said "between the lines" but i just think it will be easier to understand if it is clearly stated in the tutorial. (2) It says the following in tutorial #9
Quote:
The first thing we do is spin the scene on the x axis. If we spin 90 degrees, the x axis will no longer run left to right, it will run into and out of the screen. As an example to help clarify. Imagine you were in the center of a room. Now imagine that the left wall had -x written on it, the front wall had -z written on it, the right wall had +x written on it, and the wall behind you had +z written on it. If the room spun 90 degrees to the right, but you did not move, the wall in front of you would no longer say -z it would say -x. All of the walls would have moved. -z would be on the right, +z would be on the left, -x would be in front, and +x would be behind you. Make sense? By rotating the scene, we change the direction of the x and z planes.
Isn't this the case if we spun the scene on the y-axis? In the case above, wouldn't we be be running up and down? Sorry if i am mistaking, i am just starting out with OpenGL. These was just the things that confused me. -Mads

Share this post


Link to post
Share on other sites
If you're serious about learning OpenGL, you will certainly find this helpful. It's outdated, but still contains a lot of useful information (even though it can be hard for someone with no knowledge of 3D math and general computer graphics concepts). In your case, I recommend that you read the section in chapter 3 titled "Thinking About Transformations".

Share this post


Link to post
Share on other sites
1. were not, we are using blending here, so instead of replacing the current pixel color with the new texture derived color we add that color to the existing color.
So in case of a black pixel nothing happens because 1+0=1.
it's done using these two lines
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
glEnable(GL_BLEND);

though i would probably have used
glBlendFunc(GL_ONE,GL_ONE);
as it gives the same effect in this case

2. yes, what i think happened was that jeff when he wrote that got a little dizzy himself, a few of those rotations are not necessary.

Share this post


Link to post
Share on other sites

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