Khronos.org Message Boards

Public discussions about the Khronos Dynamic Media APIs
It is currently Thu Sep 09, 2010 4:24 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Where can I find the gluLookAtf function for OpenGL ES?
PostPosted: Mon Jan 25, 2010 6:50 am 
Offline

Joined: Sun Sep 06, 2009 7:53 am
Posts: 18
I have searched for the gluLookAtf function,but can not find it. Does anyone know where it is?


Top
 Profile E-mail  
 
 Post subject: Re: Where can I find the gluLookAtf function for OpenGL ES?
PostPosted: Fri Jan 29, 2010 1:11 am 
Offline

Joined: Fri Jan 29, 2010 1:08 am
Posts: 2
There is no such method in ES, either in standard Open GL spec either. However, maybe this can help you
void LookAt(TVector aPosition, TVector aLookAt, GLfloat aRoll)
{
TVector up, forward, right;
TReal trg = 0;
Math::Sin(trg, aRoll);
up.iX = trg;
Math::Cos(trg, aRoll);
up.iY = -trg;
up.iZ = 0;

forward.iX = aLookAt.iX - aPosition.iX;
forward.iY = aLookAt.iY - aPosition.iY;
forward.iZ = aLookAt.iZ - aPosition.iZ;

forward.Normalize();

right = TVector::CrossProduct(up, forward);
right.Normalize();

up = TVector::CrossProduct(right, forward);
up.Normalize();

// Start building the matrix. The first three rows contain the
// basis vectors used to rotate the view to point at the look-at point.
MakeIdentity(&iViewMatrix[0][0]);

iViewMatrix[0][0] = right.iX;
iViewMatrix[1][0] = right.iY;
iViewMatrix[2][0] = right.iZ;
// iViewMatrix[3][0] = -aPosition.iX;

iViewMatrix[0][1] = up.iX;
iViewMatrix[1][1] = up.iY;
iViewMatrix[2][1] = up.iZ;
// iViewMatrix[3][1] = -aPosition.iY;

iViewMatrix[0][2] = -forward.iX;
iViewMatrix[1][2] = -forward.iY;
iViewMatrix[2][2] = -forward.iZ;
// iViewMatrix[3][2] = -aPosition.iZ;
}


Top
 Profile E-mail  
 
 Post subject: Re: Where can I find the gluLookAtf function for OpenGL ES?
PostPosted: Sat Jan 30, 2010 8:53 am 
Offline

Joined: Sun Sep 06, 2009 7:53 am
Posts: 18
Thanks, do you think I can use this method to solve the problem that I have with implementing a movement ,which makes it possible to find the position in 3d space? My problem is described in detail here:

http://www.newlc.com/en/forum/how-get-p ... -opengl-es


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot], MSN [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group