OpenGL ES questions regarding 2D mixed with 3D
Hi!
Just dove into OpenGL ES 2 days back and got quite a few done.
I am trying to create something similar to the newer generation pokemon games (diamond/pearl/platinum) but so far all I get is something that comes a bit close to it.
Basically all I want to ask:
How do you create that top down view effect.
I cannot quite get it and when it "looks" alright, it isn't when I move around the map.
Any advice?
Just dove into OpenGL ES 2 days back and got quite a few done.
I am trying to create something similar to the newer generation pokemon games (diamond/pearl/platinum) but so far all I get is something that comes a bit close to it.
Basically all I want to ask:
How do you create that top down view effect.
I cannot quite get it and when it "looks" alright, it isn't when I move around the map.
Any advice?
It sounds like you probably want to play with the field of view. Having a very narrow field of view and making the objects smaller or the camera further away will get closer to having an orthographic projection. If you don't want any perspective at all there is no reason why you can't use glOrtho with 3D objects.
Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
Thing is, I've been playing around with the field of view and still cannot produce the effect I'm looking for.
Maybe it's because I don't understand glFrustumf fully but the fields I put it are from jeffs blog.
Maybe it's because I don't understand glFrustumf fully but the fields I put it are from jeffs blog.
glFrustum can be pretty confusing. gluPerspective is easier to visualize, but since glu isn't included with OpenGL ES, you'd need to do the matrix math yourself, then multiply the projection matrix by the result. There's an implementation of something nearly identical to gluPerspective in my matrix tutorial (see Matrix_applyPerspective).
Here's my gluPerspective replacement:
Code:
void setPerspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar)
{
GLfloat xmin, xmax, ymin, ymax;
ymax = zNear * tanf(fovy * M_PI / 360.0f);
ymin = -ymax;
xmin = ymin * aspect;
xmax = ymax * aspect;
glFrustumf(xmin, xmax, ymin, ymax, zNear, zFar);
}
Thanks, i'll look at the tutorial.
I'll give that code a try too jake.
One thing I forgot to mention, I use gluLookAt.
from what I understand, the first three parameters for gluLookAt are the x,y,z coordinates for where you are looking "from".
The second three parameters are where you are looking "to".
I am not sure what the last three parameters do as I get some pretty confusing results.
Do you thing gluLookAt will help in achieving this top down view effect?
I'll give that code a try too jake.
One thing I forgot to mention, I use gluLookAt.
from what I understand, the first three parameters for gluLookAt are the x,y,z coordinates for where you are looking "from".
The second three parameters are where you are looking "to".
I am not sure what the last three parameters do as I get some pretty confusing results.
Do you thing gluLookAt will help in achieving this top down view effect?
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenGL ES2... many questions | vunterslaush | 39 | 20,798 |
Sep 5, 2011 09:21 AM Last Post: ipeku |
|
| OpenGL: glRotate and some 3D questions. | mikey | 1 | 3,280 |
May 19, 2009 05:11 PM Last Post: ThemsAllTook |
|
| Basic OpenGL questions | Mercy | 5 | 4,096 |
Dec 23, 2008 10:25 AM Last Post: AnotherJake |
|
| Some OpenGL 2D questions | oskob | 16 | 8,774 |
Oct 30, 2008 12:12 PM Last Post: Wowbagger |
|
| Dreaded noob questions: OpenGL in a Cocoa App | 5thPeriodProductions | 5 | 4,028 |
Apr 10, 2006 11:08 AM Last Post: 5thPeriodProductions |
|

