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 Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-05-2008, 04:06 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: London/Peterborough
Posts: 562
QuantumDoja is on a distinguished road
Default OpenGL locationInView co-ordinates

Hi, I want to use touches in an opengl app, the problem is the co-ordinates system.

In open gl, I can draw a point at 0,0...which is the center of the iphone screen, however, touching the screen has coordinates from the top left corner at 0,0.

So my question is, How can I either shift the registration point of the opengl system 0,0, to match the top corner of the screen, or write a system to convert between the points...Has anyone got any example code?

Thanks!
QuantumDoja is offline   Reply With Quote
Old 12-05-2008, 05:27 PM   #2 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: London/Peterborough
Posts: 562
QuantumDoja is on a distinguished road
Default ints/float

hmm, its all about where the reg points are:

glOrthof(-1.0f, 1.0f, -1.5f, 1.5f, -1.0f, 15.0f); middle
glOrthof(-1.6f, 1.6f, -2.4f, 2.4f, -1.0f, 15.0f); middle
glOrthof(0, rect.size.width, 0, rect.size.height, -1, 1); bottom left
QuantumDoja is offline   Reply With Quote
Reply

Bookmarks

Tags
co-ordinates, locationinview, opengl

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: 368
16 members and 352 guests
Absentia, akphyo, apatsufas, BinHex, dre, Error404, Gaz, gmarro, jeroenkeij, Kirkout, MarkC, mottdog, Music Man, PavelMik, whitey99, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,666
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cpsclicker
Powered by vBadvanced CMPS v3.1.0

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