Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

GroZZleR

OpenGL Iso View - Trying to get the view right

This topic is 6102 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, I''m struggling with how to get these 10 quads on a good isometric view, I can''t seem to do it. Everything just goes a little flat it appears. Either way, can anyone tell me what values I should be using for gluLookAt? Currently it looks at the middle square and draws from there, based on the middle square.
int DrawGLScene(GLvoid)
{
	int tile;
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();
	gluLookAt(5.0f, 5.0f, 20.0f,   5.0f, 5.0f, 0.0f,   0.0f, 1.0f, 0.0f);
	for (int y = 0; y < MAP_SIZEY; y++)
	{
		for (int x = 0; x < MAP_SIZEX; x++)
		{
			tile = map[x][y];
			glBegin(GL_QUADS);
				glColor3f(0.2f,0.0f,0.0f);
				glVertex3f(float(x), float(y), 0.0f);
				glVertex3f(float(x + 1), float(y), 0.0f);
				glVertex3f(float(x + 1), float(y + 1), 0.0f);
				glVertex3f(float(x), float(y + 1), 0.0f);
			glEnd();
		}
	}
	return TRUE;										
}
[/CODE]

So anyone know what values I should put in gluLookAt to get a good isometric view of the tiles?    

Share this post


Link to post
Share on other sites
Advertisement
You are using gllookat? Ick. I use a matrix myself so can''t help there.

Also, what is your projection set up as? Are you using ortho, or perspective or... ?

Share this post


Link to post
Share on other sites
http://therabbithole.redback.inficad.com/tricks/isomatics.html that might help you out.

You need to know vector/matrix math, check NEHE, I think he has matrix example.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!