From: Jason M. <ko...@gm...> - 2008-08-28 19:41:02
|
On Thu, Aug 28, 2008 at 9:52 AM, Henri Häkkinen <hen...@gm...> wrote: > On Thu, Aug 28, 2008 at 12:32 PM, Jason McKesson <ko...@gm...> wrote: >> >> - We should have a series of Vec4 functions that treat their inputs as >> normalized quaternions. Basically quaternion multiplication, quaternion >> inverse, and a function to convert quaternions into rotation matrices. >> Enough to use quaternions. Oh, and a function to convert angle/axis into a >> quaternion (and one to go back?). I don't think we need a full-fledged >> quaternion type, as a 4-vector of floats is a 4-vector of floats; it's all >> in how you use it. > > I think we should implement full featured GLMquatf type. You can if you want, but we'll have to support every operation that Vec4's support on them. So if we have a "UniformVec4f" function for setting uniforms, we would need a separate "UniformQuatf" function for setting quaternions. It seems wasteful, especially if we're going to use Vec4f's for things like colors. > >> >> - All of those Mat3 functions for generating transformation matrices? We >> should have Mat4 versions as well. Since Mat3's cannot easily be converted >> into Mat4's, and Mat4's are full 3D transformation matrices, it makes sense >> to provide full coverage in generating transformation matrices at the Mat4 >> level. > > I think we should provide an entry-point for creating 4x4 matrices from 3x3 > matrix and a 3D vector as the last vertical column: > > glmMatCompose (&out, &rotation, &translation); > > or something similar. The problem there is that you have to create a mat3x3 just to create the mat4x4 that you actually want. That seems wasteful and not entirely obvious to the user. More importantly, what about the other 3 floats in "out" that are not being set by this? I know it's a pain to add another version of all of those functions (I've done it), but it really is the most obvious, simplest solution. |