Giter VIP home page Giter VIP logo

ray's Introduction

Ray Cover Image Ray Linux Cover Image

Demo Video

Demo Video

Welcome

Welcome to Ray. A C++ program that can do Raytracing in the console. This is pure bit-beauty.

License

This program is licensed under the GNU GPL v3 License. Please read the License file to know about the usage terms and conditions.

ray's People

Contributors

3samourai avatar aldrinmathew avatar alexemanuelol avatar dinoz1729 avatar flolep2607 avatar hlouzada avatar jeffmc avatar k-progs avatar unavaliabl3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ray's Issues

Sleep is a Windows function

I was trying to compile this amazing work, but on Unix there is slight difference in sleep function.
Sleep is a Windows function
For Unix, nanosleep or usleep
https://stackoverflow.com/questions/10976176/c-error-sleep-was-not-declared-in-this-scope

This is the line, where I ran into problem with compiling on Mint and g++ 9.3.0.

Ray/main.cpp

Line 207 in b6a9dbd

Sleep(5);

So, I replaced Sleep with usleep and uncomment #include <unistd.h> line and it solved my problem.

I'm not a cpp guy, but I think this issue is on point. What do you think?

functions file isn't called on main

I tried running the code but the compiler logged errors showing that a lot was not defined. I noticed you didn't call "functions.cpp" in main... I tried but it still didn't work. please fix, I wanna see ray tracing on my potato pc

Demo video is unavailable

Hi,

I wanted to check out the demo video, but youtube says it is private. That's probably not intended because the link is in the readme. Could you make it public, please?

I always get 'collect2.exe: error: ld returned 1 exit status' error while compiling

If I try to run this program, I always get collect2.exe: error: ld returned 1 exit status error. Here is my terminal output -

g++ .\main.cpp -o ray.exe

In file included from .\main.cpp:3:
.\vector.h: In member function 'double Vector::setX(double)':
.\vector.h:33:37: warning: no return statement in function returning non-void [-Wreturn-type]
     double setX(double x) { _x = x; }
                                     ^
.\vector.h: In member function 'double Vector::setY(double)':
.\vector.h:34:37: warning: no return statement in function returning non-void [-Wreturn-type]
     double setY(double y) { _y = y; }
                                     ^
.\vector.h: In member function 'double Vector::setZ(double)':
.\vector.h:35:37: warning: no return statement in function returning non-void [-Wreturn-type]
     double setZ(double z) { _z = z; }
                                     ^
In file included from .\camera.h:8,
                 from .\main.cpp:4:
.\ball.h: At global scope:
.\ball.h:11:1: warning: 'typedef' was ignored in this declaration
 typedef struct Ball
 ^~~~~~~
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0xb3): undefined reference to `Vector::set(double, double, double)'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x10a): undefined reference to `Vector::set(double, double, double)'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x161): undefined reference to `Vector::set(double, double, double)'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x27d): undefined reference to `Camera::Camera(double, double, double)'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x2e2): undefined reference to `Vector::Vector(double, double, double)'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x35b): undefined reference to `Vector::Vector(double, double, double)'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x37c): undefined reference to `Vector::transformMatrixToVector(double const*)'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x3b5): undefined reference to `Vector::~Vector()'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x430): undefined reference to `Vector::set(double, double, double)'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x43f): undefined reference to `Vector::normalize()'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x492): undefined reference to `Camera::rayTrace(Vector&, Vector&, Ball*, int, double, double, int)'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x4f7): undefined reference to `Vector::~Vector()'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x506): undefined reference to `Vector::~Vector()'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x640): undefined reference to `Camera::~Camera()'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x699): undefined reference to `Vector::~Vector()'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x6ad): undefined reference to `Vector::~Vector()'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text+0x6be): undefined reference to `Camera::~Camera()'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text$_ZN4BallC1Ev[_ZN4BallC1Ev]+0x14): undefined reference to `Vector::Vector()'
C:\Users\MAHMUD~1\AppData\Local\Temp\ccpGug26.o:main.cpp:(.text$_ZN4BallD1Ev[_ZN4BallD1Ev]+0x14): undefined reference to `Vector::~Vector()'
collect2.exe: error: ld returned 1 exit status

What could be the problem? I've tried compiling in ubuntu too and got the same error.

Make `unistd` as part of if else

Hi there!
It's looks so nice <3

Just add <unistd.h> to if else statement, and maybe some readme's for linux too ?

#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif 

3D movements

I've added 3d movements but it's using ncurses

Consider adding functions.cpp

Your "function.h" is impossible to include more than in one place, it will cause "multiple definition" error (I know you include it once, but what if someone else wants to reuse it). This happens because it contains declaration and implementation of functions. If you move implementations to pair functions.cpp file, you would solve this problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.