Advertisement
thecplusplusguy

OpenGL (SDL,C++) - ray tracing - functions.h

Sep 29th, 2011
3,168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. //http://www.youtube.com/user/thecplusplusguy
  2. //watch the video for explonation
  3. //ray-sphere and ray-plane collision detection.
  4. //if you find a bug, let me know
  5. #include <SDL/SDL.h>
  6. #include <GL/gl.h>
  7. #include <GL/glu.h>
  8. #include <cstdlib>
  9. #include <vector>
  10. #include <string>
  11. #include <algorithm>
  12. #include <fstream>
  13. #include <cstdio>
  14. #include <iostream>
  15. #include <cmath>
  16. #include "objloader.h"
  17. #ifndef FUNCTION_H
  18. #define FUNCTION_H
  19.  
  20. void drawCube(float size);
  21. void drawSkybox(float size);
  22. void initskybox();
  23. void killskybox();
  24. void lockCamera();
  25. void moveCamera(float,float);
  26. void moveCamerraUp(float,float);
  27. void Control(float,float,bool);
  28. void UpdateCamera();
  29. unsigned int loadTexture(const char*);
  30. bool raysphere(float xc,float yc, float zc,float xd,float yd, float zd,float xs,float ys, float zs,float r);
  31. bool rayplane(float nx,float ny,float nz,float xs,float ys,float zs,float xd,float yd,float zd,coordinate p1,coordinate p2,coordinate p3,coordinate p4);
  32. float trianglearea(coordinate p1,coordinate p2,coordinate p3);
  33. #endif
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement