#10 cgkit2 mat4.lookAt() bug

closed
nobody
None
5
2006-07-31
2006-07-30
Richard Jones
No

The following code shows the bug:

>>> from cgkit.cgtypes import *
>>> mat4(1).lookAt(vec3(1,1,1),(1,1,1), up=(0,1,0))
Traceback (most recent call last):
File "<stdin>", line 1, in ?
Boost.Python.ArgumentError: Python argument types in
mat4.lookAt(mat4, vec3, tuple)
did not match C++ signature:
lookAt(support3d::mat4<double>*,
support3d::vec3<double> pos, support3d::vec3<double>
target)
lookAt(support3d::mat4<double>*,
support3d::vec3<double> pos, support3d::vec3<double>
target, support3d::vec3<double> up)
>>>

If the line "mat4.lookAt(mat4, vec3, tuple)" is
reporting the arguments I passed in then it's clearly
wrong (it should be saying "(vec3, tuple, tuple)").

This is using cgkit 2.0.0alpha6 compiled from source.

Boost installed via apt-get:

boost-build 2.0-m10-1ubuntu1
libboost-dev 1.33.1-2
libboost-python-dev 1.33.1-2
libboost-python1.33.1 1.33.1-2

Discussion

  • Matthias Baas
    Matthias Baas
    2006-07-31

    • status: open --> closed
     
  • Matthias Baas
    Matthias Baas
    2006-07-31

    Logged In: YES
    user_id=211477

    The exception you're seeing is generated by Boost.Python.
    The last tuple doesn't appear in the error message because
    it is a keyword argument.
    The actual problem with your method call is that the last
    two arguments are tuples whereas Boost.Python expects vec3
    objects. The following method call would work:

    mat4(1).lookAt(vec3(1,1,1), vec3(1,1,1), up=vec3(0,1,0))

    But I've just committed an update that also allows
    sequences of 3 floats (such as tuples) to be passed
    wherever vec3 arguments are expected. So with the current
    svn version your original method call from above would
    also work.

    But actually you would also get an exception because the
    position and the target are identical. In this case,
    there's no direction in which you are looking and the
    resulting transformation is not defined.

    - Matthias -