From: Branan R. <br...@gm...> - 2008-08-28 21:19:49
|
I'm still at work. I'll take a detailed look at it in about 2.5 hours, if no one else has by then Branan On Thu, Aug 28, 2008 at 2:14 PM, Henri Häkkinen <hen...@gm...> wrote: > I am unable to get glmMatLookAt4f function working. I am following the > formula given in the gluLookAt manpage, but still no luck. Could somebody > take a look at my code? The test case gives me a failure. Here is my local > copy of the function (the repos version is outdated). > > GLMmat4f * > glmMatLookAt4f (GLMmat4f *out, > const GLMvec3f *eye, > const GLMvec3f *center, > const GLMvec3f *up) > { > GLMmat4f t; > GLMvec3f f, s, u; > > assert (out); > assert (eye); > assert (center); > assert (up); > > /* FIXME: not working */ > /* FIXME: unoptimal implementation */ > > glmVecSub3f (&f, center, eye); > glmVecNormalize3f (&f, &f); > glmVecNormalize3f (&u, up); > glmVecCross3f (&s, &f, &u); > glmVecCross3f (&u, &s, &f); > > out->m00 = s.x; > out->m01 = s.y; > out->m02 = s.z; > out->m03 = 0.0f; > out->m10 = u.x; > out->m11 = u.y; > out->m12 = u.z; > out->m13 = 0.0f; > out->m20 = -f.x; > out->m21 = -f.y; > out->m22 = -f.z; > out->m23 = 0.0f; > out->m30 = 0.0f; > out->m31 = 0.0f; > out->m32 = 0.0f; > out->m33 = 1.0f; > > glmMatIdentity4f (&t); > t.m03 = -eye->x; > t.m13 = -eye->y; > t.m23 = -eye->z; > > glmMatMul4f (out, out, &t); > return out; > } > > > -- > Henri 'henux' Häkkinen > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Glsdk-devel mailing list > Gls...@li... > https://lists.sourceforge.net/lists/listinfo/glsdk-devel > > |