 |
 |
|
 |
02-09-2010, 10:08 AM
|
#1 (permalink)
|
|
Registered Member
Join Date: Nov 2009
Location: Vic, Catalunya (Spain)
Posts: 173
|
Can't work with OpenGL and landscape...
Hi there!
After sending my first game to Apple (in review at this time!) it's time to begin with the second one! For this one I need to set OpenGL ES in landscape mode. I've started doing some game tests in a project in portrait mode but when I try to port this to landscape nothing work as it used to...
I know how to set landscape mode in the .plist file and also how to set OpenGL to draw in landscape mode:
Code:
glOrthof( -rect.size.width / 2, rect.size.width / 2, -rect.size.height / 2, rect.size.height / 2, -1, 1 );
(...)
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(160.0f, 240.0f, 0.0f );
glRotatef(-90.0, 0.0, 0.0, 1.0);
glScalef(1.0, -1.0, 1.0);
Objects are now drawn in landscape mode as it was expected, but nothing's changed with this, so there's no axis inversion and objects didn't even seem to be where they're drawn (so for touching an object I must touch the screen zone where it used to be in portrait mode)... Is there any way of setting OpenGL in a landscape context and setting all with this (so no need to turn head to image how axis are going or where the object is, instead it's printed in other point? I'm getting quite mad with this... U_U'
Thanks in advance!
Last edited by Johanovski; 02-09-2010 at 10:14 AM.
|
|
|
02-10-2010, 03:11 AM
|
#2 (permalink)
|
|
Registered Member
Join Date: Nov 2009
Location: Vic, Catalunya (Spain)
Posts: 173
|
Anyone has anything to say about this? I'm really getting mad with inverted axis, x than became y, y that have it's starting point where it's supposed to be 480, OpenGL and touches processing x and y inverted, ...
|
|
|
02-10-2010, 05:55 AM
|
#3 (permalink)
|
|
Maker of Games
Join Date: Nov 2009
Location: Coventry, UK
Posts: 288
|
Create a class to remap your co-ordinate systems, and just convert as needed. You could role it into your co-ordinate class as well, and have explicit accessors.
__________________
Visit Mr Jack Games for my blog and more about my games
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 355 |
| 37 members and 318 guests |
| alekssebasstrs, Batman, Bertrand21, BrianSlick, CapsicumDreams, Chilibird, chrish2os, computermatt, davidneal, desireapps, EmprendeSoft, Eric 54, flamingliquid, graph, harkonian, Hololont, iTrackiGiveaway, itzdark, jamison, javaconvert, joalta, justill45, Kyowoo, miniyou64, mobiledna, Moddy, redmouse, rendezvouscp, Rudy, scotopia, SimonCowell, sjarman, snowboarderz69, stlau, theM, toughturtle, walkman2001 |
| Most users ever online was 779, 05-11-2009 at 09:55 AM. |
» Stats |
Members: 24,320
Threads: 39,117
Posts: 171,512
Top Poster: smasher (2,576)
|
| Welcome to our newest member, xX Holllish Xx |
|