Jump to content
• Advertisement

# Lesson #9

This topic is 3999 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

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

##### Share on other sites
Advertisement
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

##### 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

##### Share on other sites

• Advertisement

### Announcements

• Advertisement

• ### Popular Contributors

1. 1
2. 2
3. 3
Rutin
15
4. 4
khawk
14
5. 5
frob
12
• Advertisement

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633661
• Total Posts
3013220
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!