clipping.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * 3D Engine
  3. * clipping.h:
  4. * Based on pikuma.com 3D software renderer in C
  5. * Copyright (c) 2021 986-Studio. All rights reserved.
  6. *
  7. * Created by Manoël Trapier on 11/03/2021.
  8. */
  9. #ifndef THREEDENGINE_SOURCE_INCLUDE_CLIPPING_H
  10. #define THREEDENGINE_SOURCE_INCLUDE_CLIPPING_H
  11. #include <vector.h>
  12. /***********************************************************************************************************************
  13. * Data types
  14. **********************************************************************************************************************/
  15. enum
  16. {
  17. TOP_PLANE = 0,
  18. RIGHT_PLANE,
  19. BOTTOM_PLANE,
  20. LEFT_PLANE,
  21. NEAR_PLANE,
  22. FAR_PLANE,
  23. /* Keep at the end */
  24. TOTAL_PLANES
  25. };
  26. typedef struct plane_t
  27. {
  28. vec3_t point;
  29. vec3_t normal;
  30. } plane_t;
  31. /***********************************************************************************************************************
  32. * Prototypes
  33. **********************************************************************************************************************/
  34. void initFrustumPlanes(double fov, double aspectRation, double zNear, double zFar);
  35. #endif /* THREEDENGINE_SOURCE_INCLUDE_CLIPPING_H */