Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-12-2011, 11:35 PM   #1 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 9
jebadiah is on a distinguished road
Default OpenGL Texture Mapping problem

Hello.

I am currently using a sample code from OReilly's iPhone 3d projects. Specifically, this one: Index of /9780596804831/CameraTexture

I try to change the texture image into a picture of earth but it is displayed 3x like so:



I am currently using:
Code:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
What I need is to wrap the image around the sphere so it looks like an actual globe.

Do you have any idea how I might be able to this?

Thank you.
jebadiah is offline   Reply With Quote
Old 01-13-2011, 09:46 AM   #2 (permalink)
Registered Member
 
Join Date: Dec 2010
Posts: 15
anorak is on a distinguished road
Default

My only guess is that the texture coordinates that are generated are not exactly what you want.Take a look at how the sphere and texture coordinates are constructed.
anorak is offline   Reply With Quote
Old 02-16-2011, 11:08 AM   #3 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 9
jebadiah is on a distinguished road
Default

Quote:
Originally Posted by anorak View Post
My only guess is that the texture coordinates that are generated are not exactly what you want.Take a look at how the sphere and texture coordinates are constructed.
Thank you very much. I found that in the ParametricEquations.hpp, the texture is set to repeat 3x. I simply changed the values to (1,1) and the texture was fixed.

Hope this helps others too!
jebadiah is offline   Reply With Quote
Old 02-16-2011, 11:19 AM   #4 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 9
jebadiah is on a distinguished road
Default

By the way, I was also experimenting with the procedural sphere with texture using this sphere tutorial along with this texture tutorial. I attached an image to show the problem though it is almost the same as my problem above.


I am thinking that the problem might lie in this code:
Code:
glTexCoordPointer(3, GL_FLOAT, 0, sphereTriangleStripVertices);
but I have had no success in fixing it.

Please help as I am trying to study which sphere rendering would be best for my app.

Thank you in advance!
Attached Images
File Type: jpg earth1.jpg (5.7 KB, 0 views)
File Type: jpg earth2.jpg (5.7 KB, 0 views)
jebadiah is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 414
10 members and 404 guests
7twenty7, chemistry, ChrisYates, gmarro, hussain1982, Retouchable, skrew88, SLIC, walex, xzoonxoom
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,679
Threads: 94,128
Posts: 402,921
Top Poster: BrianSlick (7,990)
Welcome to our newest member, xzoonxoom
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:09 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0