OpenGL|ES tutorials - Follows NeHe track.

Nibbie
Posts: 1
Joined: 2009.02
Post: #31
I love these tutorials-- awesome. Remember that you need to set the Viewport whether you use the replacement function for gluPerspective or if you use glFrustrum. Spelling this out, you'll want something like this for gluPerspective usage:

[INDENT]-(void)setupView:(OpenGLCoreView*)view
{
// Try this with gluPerspective
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
CGRect rect = view.bounds;
[self gluPerspective:60.0fSad(GLfloat)rect.size.width/(GLfloat)rect.size.height):0.1f:1000.0f];
glViewport(0, 0, rect.size.width, rect.size.height);

// Make the OpenGL modelview matrix the default
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
// Clears the view with black
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
}[/INDENT]
Quote this message in a reply
Member
Posts: 36
Joined: 2009.02
Post: #32
Great tutorial, thanks!
Quote this message in a reply
Apprentice
Posts: 13
Joined: 2008.10
Post: #33
Hey everyone,

Please forgive the long wait. I work as a developer for a living and we had a serious crunch time with a release. Things have finally slowed back down. I'll be doing my best to get back on track with these tutorials. Thanks for the enthusiastic support and keep an eye here for Tutorial #6.

Christian "Dragagon" Richards
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2009.03
Post: #34
Hi,

could anyone please help me with adding a viewcontroller to this project? Since there is no xib file, i don't know how to do so.

Thanks
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2009.04
Post: #35
Has anyone had any trouble in getting the colored pyramid to show up correctly? I am able to get the colored cube to show, but when commenting out the cube rendering code and attempting to get the pyramid rendered, all I get is a black screen. Sad

I think it has to do with the glDrawElements, but am not too sure. Sad

Great tutorial thus far though! Grin
Quote this message in a reply
Nibbie
Posts: 2
Joined: 2009.04
Post: #36
Hey, these are great. Really helpful. Help me out, tho...

I'm racking my brain trying to figure out how to access the transformed model co-ordinates. Can anyone set me on the right track to reading transformed vertex data?

For example: my cube is spinning around nicely. Say I want something to happen when a particular corner of this cube is closest to the camera. How would I do that? How would I do that without knowing the Z position of said vertex? How would I get to that information?

Buffers? Display lists?

Thanks in advance.
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2009.04
Post: #37
"Has anyone had any trouble in getting the colored pyramid to show up correctly?"

Yes, it took me a very long time to figure out where I was going wrong. Turns out the example isn't quite right again. The pyramid indexes are declared as floats while the cubes are shorts. Changing pyramid to short fixed it for me, but had me chasing my tail for hours.

These are great examples, and I'm very thankful that they were put up, but they really do need some cleaning and testing. (colors needing 4 vs. 3, array of floats vs. bytes, etc.)
Quote this message in a reply
Member
Posts: 166
Joined: 2009.04
Post: #38
steve_mock Wrote:Hey, these are great. Really helpful. Help me out, tho...

I'm racking my brain trying to figure out how to access the transformed model co-ordinates. Can anyone set me on the right track to reading transformed vertex data?

For example: my cube is spinning around nicely. Say I want something to happen when a particular corner of this cube is closest to the camera. How would I do that? How would I do that without knowing the Z position of said vertex? How would I get to that information?

Buffers? Display lists?

Thanks in advance.

You can't really do that with the original vertex data since there is no such thing as "transformed vertex data".

You will need to simulate that yourself ... either use your internal AABox ( if you have one) or simply keep a point and transform it yourself.
Quote this message in a reply
Nibbie
Posts: 2
Joined: 2009.04
Post: #39
Thanks. I kinda' was hoping someone would say "You can't do that," so I can move on.
Quote this message in a reply
Apprentice
Posts: 13
Joined: 2009.03
Post: #40
just released lesson 7 - rotating cube with wooden crate texture
http://github.com/haqu/iphone-nehe/tree/master

tapping with one finger will toggle lighting
two fingers to toggle texture antialiasing

iPlayful : games for iPhone and iPod Touch
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Track down an autorelease bug kendric 2 3,349 Jun 28, 2009 05:09 AM
Last Post: kendric