Hi Guys,
I'm using the great iPhone template provided at http://irrlicht.sourceforge.net/forum/v ... 5&start=90
But I want the project to be a landscape view rather than portrait on the iPhone. I've searched these forums but didn't find a method that worked for me.
I was hoping someone familiar with the template or even just irrlicht on iPhone in general would be able to provide some guidance.
Thanks in advance!
Irrlicht on iPhone in Landscape mode
Re: Irrlicht on iPhone in Landscape mode
Can't you just rotate the camera?
Re: Irrlicht on iPhone in Landscape mode
No, I've tried that, setUpVector(0,0,-90) will rotate the camera and skybox but gui elements and other objects appear on their side and incorrectly placed.
Anyone got any other ideas?
Anyone got any other ideas?
Re: Irrlicht on iPhone in Landscape mode
Another quick question that has also popped up and stumped me. If I load and display a png image it shows up as plain white, whereas jpg or bmp shows correctly.
Any clues?
Any clues?
Re: Irrlicht on iPhone in Landscape mode
I Rotate so
and
Code: Select all
#include <CoreGraphics/CoreGraphics.h>
#include <CoreGraphics/CGAffineTransform.h>
#define degreesToRadian(x) (M_PI * (x) / 180.0)
Code: Select all
UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice] orientation];
UIView * SupperView=[glView superview];
CGAffineTransform transform = CGAffineTransformIdentity;
//////////////////// Landscape
if(deviceOrientation==UIDeviceOrientationLandscapeRight)
{
transform = CGAffineTransformMakeRotation(degreesToRadian(270));
[SupperView setTransform:transform];
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
}
else if(deviceOrientation==UIDeviceOrientationLandscapeLeft)
{
transform = CGAffineTransformMakeRotation(degreesToRadian(90));
[SupperView setTransform:transform];
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft];
}
//////////////////// Portrait
else if(deviceOrientation==UIDeviceOrientationPortrait)
{
transform = CGAffineTransformMakeRotation(degreesToRadian(0));
[SupperView setTransform:transform];
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];
}
else if(deviceOrientation==UIDeviceOrientationPortraitUpsideDown)
{
transform = CGAffineTransformMakeRotation(degreesToRadian(180));
[SupperView setTransform:transform];
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortraitUpsideDown];
}
////////////////////