Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
mymath.7z | 2011-08-11 | 14.3 kB | |
example-opengl-sphere-worlds.7z | 2011-08-11 | 163.0 kB | |
readme.txt | 2011-08-11 | 2.7 kB | |
Totals: 3 Items | 180.0 kB | 0 |
--- Readme of mymath library --- Welcome! Let me introduce the mymath library. Mymath is a 3d maths library created with the intention to modernize 3d maths libraries, and meanwhile preserve simplicity and flexibility. Mymath is written in C++, it uses a modern object-oriented approach. It includes a camera class, which you can use for camera handling. It also includes a matrix stack class, which you can use as a replacement for the OpenGL functions. Mymath contains 2, 3, and 4 component vector classes and many functions using these classes. Mymath also contains 3x3 and 4x4 matrix classes. Mymath is based on the math3d library and contains similar functions. However these functions are modernized, and even some new functions are included. Some important things to mention: -matrices are stored in row-major order see: http://en.wikipedia.org/wiki/Row-major_order -you can access matrices by using the “[]” operator (with value 0-8, and 0-15), and also by using the “get_2d_m3x3” function (and there is also a 4x4 version), with which you can access matrices in a 2 dimensional manner -vectors are generally treated as row vectors, however in some cases they might be used as column ones -the “get_angle_bw_2_vec3f” requires the input vectors to be unit length, you can make them unit length with the “normalize_vec3f” function You can find some examples in the “main.cpp” file. You can also find an example borrowed form OpenGL Suberbible 5th edition, in which it is shown how you can you it in your OpenGL project. How can I link this library to my project? -Well in cmake all you have to do is: 1. build the mymath library using the CMakeLists.txt provided 2. copy the header files to [your project's source dir]/mymath/include, and the .dll/.so files to [your project's source dir]/mymath/lib 3. put the following lines in your project's CMakeLists.txt at the beginning (after specifying the project's name) #including the header files include_directories(${CMAKE_SOURCE_DIR}/mymath/include/) #linking in the .dll/.so files link_directories(${CMAKE_SOURCE_DIR}/mymath/lib/) 4. put the following lines to the end of your project's CMakeLists.txt #getting the mymath library set(libmymath mymath_main m3x3 m4x4 vec2f vec3f vec4f camera matrix_stack pipeline) #linking against the mymath library target_link_libraries(proba2 ${libmymath}) Some notes on matrices: -get_camera_matrix(false) gives you the modelview matrix with parameter true it gives you an identity matrix How do I unrar/unzip/decompress the files? -you can do it easily by using a free compressing tool called "7z" (http://www.7-zip.org/)