项目作者: sinanislekdemir

项目描述 :
Ansi-C 3D Library
高级语言: C
项目地址: git://github.com/sinanislekdemir/ansic3d.git
创建时间: 2017-07-15T20:12:53Z
项目社区:https://github.com/sinanislekdemir/ansic3d

开源协议:GNU General Public License v3.0

下载


Ansi C 3D Math Library

Build Status

Some codes are derived from GLScene project (glscene.org)

I needed a basic ansi-c 3D library for another project of mine so I started
this project. I implemented my own needs within the library.

Documenting the library in README is a heavy job so instead, best documentation
is the code itself. So you may find the needed information in header files.

And for the use cases, you can refer to tests/test.c

Installing

BBee Build tool is already inside the repo (https://github.com/sinanislekdemir/bbee)

To compile the library (to build/libansic3d.a):

  1. python bbee

To install the library:

  1. python bbee --install

To compile and run the tests

  1. python bbee --i=test.json

Or just run to compule and install the library and run the tests.

  1. ./build.sh

Tests

  1. $ bbee --i=test.json
  2. Building using gcc
  3. Collecting files
  4. Building ./tests/test.c
  5. Running build/test
  6. TestCloneVector [OK]
  7. TestAddVector [OK]
  8. TestSubVector [OK]
  9. TestScaleVector [OK]
  10. TestCrossProduct [OK]
  11. TestNormalizeVector [OK]
  12. TestDivideVector [OK]
  13. TestPerpendicularVector [OK]
  14. TestRotateAroundX [OK]
  15. TestRotateAroundY [OK]
  16. TestRotateAroundZ [OK]
  17. TestVectorLength [OK]
  18. TestDotProduct [OK]
  19. TestVectorNorm [OK]
  20. TestVectorDistance [OK]
  21. TestPlaceNormal [OK]
  22. TestInitVectorList [OK]
  23. TestPushVector [OK]
  24. TestFreeVectorList [OK]
  25. TestPopVector [OK]
  26. TestRemoveLastVector [OK]
  27. TestTrimVectorList [OK]
  28. TestHomogeneousMatrix [OK]
  29. TestCreateScaleMatrix [OK]
  30. TestCreateTranslationMatrix [OK]
  31. TestCreateScaleAndTranslationMatrix [OK]
  32. TestCreateRotationMatrixX [OK]
  33. TestCreateRotationMatrixY [OK]
  34. TestCreateRotationMatrixZ [OK]
  35. TestCreateRotationMatrix [OK]
  36. TestMultiplyMatrix [OK]
  37. TestVectorTransform [OK]
  38. TestMatrixDeterminant [OK]
  39. TestAdjointMatrix [OK]
  40. TestScaleMatrix [OK]
  41. TestInvertMatrix [OK]
  42. TestTransposeMatrix [OK]
  43. TestLookAtMatrix [OK]

Creator

sinan islekdemir | sinan@islekdemir.com

Note

I only compiled the code under MacOs so let me know if it works for you too.