GithubHelp home page GithubHelp logo

computer-graphics-ray-casting's Introduction

Computer Graphics – Ray Casting

To get started: Clone this repository and its submodule using

git clone --recursive http://github.com/alecjacobson/computer-graphics-ray-casting.git

Do not fork: Clicking "Fork" will create a public repository. If you'd like to use GitHub while you work on your assignment, then mirror this repo as a new private repository: https://stackoverflow.com/questions/10065526/github-how-to-make-a-fork-of-public-repository-private

Background

Read Sections 4.1-4.4 of Fundamentals of Computer Graphics (4th Edition).

We will cover basic shading, shadows and reflection in the next assignment.

Scene Objects

This assignment will introduce a few primitives for 3D geometry: spheres, planes and triangles. We'll get a first glimpse that more complex shapes can be created as a collection of these primitives.

The core interaction that we need to start visualizing these shapes is ray-object intersection. A ray emanating from a point (e.g., a camera's "eye") in a direction can be parameterized by a single number . Changing the value of picks a different point along the ray. Remember, a ray is a 1D object so we only need this one "knob" or parameter to move along it. The parametric function for a ray written in vector notation is:

For each object in our scene we need to find out:

  1. is there some value such that the ray lies on the surface of the object?
  2. if so, what is that value of (and thus what is the position of intersection $\mathbf{r}(t)\in \mathbb{R}^3 $
  3. and what is the surface's unit normal vector at the point of intersection.

For each object, we should carefully consider how many ray-object intersections are possible for a given ray (always one? sometimes two? ever zero?) and in the presence of multiple answers choose the closest one.

Question: Why keep the closest hit?

Hint: 🤦🏻

In this assignment, we'll use simple representations for primitives. For example, for a plane we'll store a point on the plane and the normal anywhere on the plane.

Question: How many numbers are needed to uniquely determine a plane?

Hint: A point position (3) + normal vector (3) is too many. Consider how many numbers are needed to specify a line in 2D.

Camera

In this assignment we will pretend that our "camera" or "eye" looking into the scene is shrunk to a single 3D point in space. The image rectangle (e.g., 640 pixels by 360 pixels) is placed so the image center is directly in front of the "eye" point at a certain "focal length" . The image of pixels is scaled to match the given width and height defined by the camera. Camera is equipped with a direction that moves left-right across the image , up-down , and from the "eye" to the image . Keep in mind that the width and height are measure in the units of the scene, not in the number of pixels. For example, we can fit a 1024x1024 image into a camera with width and height .

Note: The textbook puts the pixel coordinate origin in the bottom-left, and uses as a column index and as a row index. In this assignment; the origin is in the top-left, is a row index, and is a column index.

Question: Given that points right and points up, why does minus point into the scene?

Hint: ☝️

Our pinhole perspective camera with notation (inspired by [Marschner & Shirley 2015])

Triangle Soup

Triangles are the simplest 2D polygon. On the computer we can represent a triangle efficiently by storing its 3 corner positions. To store a triangle floating in 3D, each corner position is stored as 3D position.

A simple, yet effective and popular way to approximate a complex shape is to store list of (many and small) triangles covering the shape's surface. If we place no assumptions on these triangles (i.e., they don't have to be connected together or non-intersecting), then we call this collection a "triangle soup".

When considering the intersection of a ray and a triangle soup, we simply need to find the first triangle in the soup that the ray intersects first.

False color images

Our scene does not yet have light so the only accurate rendering would be a pitch black image. Since this is rather boring, we'll create false or pseudo renderings of the information we computed during ray-casting.

Object ID image

The simplest image we'll make is just assigning each object to a color. If a pixel's closest hit comes from the -th object then we paint it with the -th rgb color in our color_map.

This "object id image" shows which object is closest along the ray passing through each pixel. Each object is assigned to its own unique color.

Depth images

The object ID image gives us very little sense of 3D. The simplest image to encode the 3D geometry of a scene is a depth image. Since the range of depth is generally where is the distance from the camera's eye to the camera plane, we must map this to the range to create a grayscale image. In this assignment we use a simple non-linear mapping based on reasonable default values.

This grayscale "depth image" shows the distance to the nearest object along the ray through each pixel. Shorter distances are brighter than farther distances.

Normal images

The depth image technically captures all geometric information visible by casting rays from the camera, but interesting surfaces will appear dull because small details will have nearly the same depth. During ray-object intersection we compute or return the surface normal vector at the point of intersection. Since the normal vector is unit length, each coordinate value is between . We can map the normal vector to an rgb value in a linear way (e.g., ).

Although all of these images appear cartoonish and garish, together they reveal that ray-casting can probe important pixel-wise information in the 3D scene.

This colorized "normal image" shows surface normal at the nearest point in the scene along the ray through each pixel.

Tasks

In this assignment you will implement core routines for casting rays into a 3D and collect "hit" information where they intersect 3D objects.

Whitelist

This assignment uses the Eigen for numerical linear algebra. This library is used in both professional and academic numerical computing. We will use its Eigen::Vector3d as a double-precision 3D vector class to store data for 3D points and 3D vectors. You can add (+) vectors and points together, multiply them against scalars (*) and compute vector dot products (a.dot(b)). In addition, #include <Eigen/Geometry> has useful geometric functions such as 3D vector cross product (a.cross(b)).

src/write_ppm.cpp

See computer-graphics-raster-images.

src/viewing_ray.cpp

Construct a viewing ray given a camera and subscripts to a pixel.

src/first_hit.cpp

Find the first (visible) hit given a ray and a collection of scene objects

Sphere::intersect_ray in src/Sphere.cpp

Intersect a sphere with a ray.

Plane::intersect_ray in src/Plane.cpp

Intersect a plane with a ray.

Running ./raycasting should produce id.ppm that looks like this.

Running ./raycasting should produce depth.ppm that looks like this.

Running ./raycasting should produce normal.ppm that looks like this.

Triangle::intersect_ray in src/Triangle.cpp

Intersect a triangle with a ray.

Running ./raycasting ../data/triangle.json should produce id.ppm that looks like this.

TriangleSoup::intersect_ray in src/TriangleSoup.cpp

Intersect a triangle soup with a ray.

Running ./raycasting ../data/bunny.json should produce images that like this. Note: This example may take a while to compute; try using a release build if you're confident your code works.

Pro Tip: Mac OS X users can quickly preview the output images using

./raycasting && qlmanage -p {id,depth,normal}.ppm

Flicking the left and right arrows will toggle through the results

Pro Tip: After you're confident that your program is working correctly, you can dramatic improve the performance simply by enabling compiler optimization:

mkdir build-release
cd build-release
cmake ../ -DCMAKE_BUILD_TYPE=Release
make

computer-graphics-ray-casting's People

Contributors

abhimadan avatar alecjacobson avatar psarahdactyl avatar rarora7777 avatar texify[bot] 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

computer-graphics-ray-casting's Issues

Sphere Ray Intersection

For ray-sphere intersection, do we need to consider the case where the image plane cuts the sphere into half. (i.e. 0 < t1 < 1, t2 > 1)

Long Run Time for Bunny

After comparing with a few classmates, it seems we're all taking at least 5-10 minutes to generate the bunny image (even on decently high end desktops). In README.html it says this should only take a few seconds, so we're wondering if this is correct. We're also concerned because the ray tracing lab is taking over an hour to run.

Is this just a typo, or are we missing something?

IOError: .\bunny.stl could not be opened...

I‘m using visual studio 2017 on windows 10 and got this error.
I found in "read_json.h", line 110, the value of variable "stl_path" is just "bunny.stl". So how should I fix it? Change the path of "bunny.stl" through "bunny.json" or copy the STL model to the "build" folder?

How to run the release build

I did the following

mkdir build-release
cd build-release
cmake ../ -DCMAKE_BUILD_TYPE=Release
make

but make gives the following outcome:
make: *** No targets specified and no makefile found. Stop.
I am on windows and install the make using

choco install make

right now is an issue is that the bunny takes forever to run... I know by using build release, I can do this much faster... but the make on windows doesn't seem to be working...? For assignment 1, I just open the sln file in visual studio and build the solution, this will generate a folder called Debug in build_release folder. And I will cd to that Debug folder and execute the exe from there. I tried the same thing for assignment 2... but the running time of bunny is just way too long. ... any suggestion or advice on running this on windows?

`objects` vector empty after `read_json`

I'm currently debugging my code to see why all my .ppm files are displaying empty black images. I inserted a line in main.cpp right after the read_json script is executed to populate the 'objects' vector:

// Read a camera and scene description from given .json file
read_json(argc<=1?"../shared/data/sphere-and-plane.json":argv[1],camera,objects);
std::cout << objects.size()

I found that the output for this is always 0, which explains the blank images. Is anyone else encountering this issue???

Triangle Soup Normal Direction

Every triangle will have two surface normals, one in the "+ve" direction and one in the "-ve" direction. For the normal we return, are we supposed to pick a specific one? The reason I am asking is I get this image as my normal.ppm. While for the most of it it looks correct, the colors aren't the same as the one in the assignment description. I'm guessing that's because some normals are pointing in a certain direction and some are pointing in another. Is there a specific direction we're supposed to be picking? If so, what is it?

normal

Problem With Building The Project

I had just finished the code of my A2, however, when I was trying to make the executable. An error occurred when building the main function while I have no idea how to fix this problem. Here is the screenshot of the error message.

alt text

alexander@AlexanderLeeLight:/mnt/c/18fall/csc418/A2/computer-graphics-ray-casting-master/build$ make
Scanning dependencies of target raycasting
[ 11%] Building CXX object CMakeFiles/raycasting.dir/src/first_hit.cpp.o
[ 22%] Building CXX object CMakeFiles/raycasting.dir/src/Plane.cpp.o
[ 33%] Building CXX object CMakeFiles/raycasting.dir/src/Sphere.cpp.o
[ 44%] Building CXX object CMakeFiles/raycasting.dir/src/Triangle.cpp.o
[ 55%] Building CXX object CMakeFiles/raycasting.dir/src/TriangleSoup.cpp.o
[ 66%] Building CXX object CMakeFiles/raycasting.dir/src/viewing_ray.cpp.o
[ 77%] Building CXX object CMakeFiles/raycasting.dir/src/write_ppm.cpp.o
[ 88%] Building CXX object CMakeFiles/raycasting.dir/main.cpp.o
In file included from /mnt/c/18fall/csc418/A2/computer-graphics-ray-casting-master/main.cpp:6:0:
/mnt/c/18fall/csc418/A2/computer-graphics-ray-casting-master/include/read_json.h: In lambda function:
/mnt/c/18fall/csc418/A2/computer-graphics-ray-casting-master/include/read_json.h:94:22: error: converting to ‘std::tuple<Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1> >’ from initializer list would use explicit constructor ‘constexpr std::tuple< >::tuple(_UElements&& ...) [with _UElements = {Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>}; = void; _Elements = {Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>}]’
tri->corners = {
^
/mnt/c/18fall/csc418/A2/computer-graphics-ray-casting-master/include/read_json.h:121:24: error: converting to ‘std::tuple<Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1> >’ from initializer list would use explicit constructor ‘constexpr std::tuple< >::tuple(_UElements&& ...) [with _UElements = {Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>}; = void; _Elements = {Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>}]’
tri->corners = {
^
CMakeFiles/raycasting.dir/build.make:230: recipe for target 'CMakeFiles/raycasting.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/raycasting.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/raycasting.dir/all' failed
make[1]: *** [CMakeFiles/raycasting.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

bunny takes forever to run

I ran it on my linux virtual machine and it usually takes 5-7 min, for cdf machine it takes more than 15 min, is it normal?

Which .json files will be graded for assignment 2?

In the shared directory there are 6 .json files .. however in the README section of the github page, there are only 3 image results being shown (I guess we are expected to produce the same output as the images shown).

Are we going to be graded based on just the three images in the readme or all the .json files within the shared directory ?

I cannot find any information about how we are graded on the Readme section of the page.

Pixel Coordinates

My implementation for write_ppm assumes pixel (0,0) is the one in the top left corner since that's how we have to write the file. For assignment 2, the equation for calculating the view ray’s direction (specifically the one for calculating v) assumes pixel (0,0) is the one in the bottom left corner. So when writing my implementation for this assignment, should I change the equation for v to have (0,0) as the top left corner or should I change write_ppm to assume (0,0) is the bottom left corner?

Triangle is working and but triangle soup isn't working.

I am able to print out a triangle by completing intersecting for triangle. However, when I run the triangle soup it wasn't working, the background printed ok but the triangles for the bunny were really scattered. I am not too sure why it is like this. How can I debug my code to check where the error is?

make error

fatal erroe: Eigen/Core: No such file or directory 
#include <Eigen/Core>

confusion on focal length and eye position

When i was writing code for viewing_ray, i noticed that in the .json files, the eye and the focal length have different values. Example, for the sphere_and_plane.json file,

"focal_length": 3,
"eye": [0,0,5],

So I am bit confused here as based on lecture, I though the eye would be positioned at the focal point.

Another point, in the readme, its mentioned -

The image rectangle (e.g., 640 pixels by 360 pixels) is placed so the image center is directly in front of the "eye" point at a certain "focal length" $d$.

However, in some of the .json files, i dont think it follows this assumption. For example, in the sphere-packing.json file,

"eye": [9.6,0.3,10],

So is the eye positioned such that it is looking at the image screen at an angle? Or is the image plane also rotated to match the eye?

textbook page 78

according to the method given by the textbook, to consider ray&triangle intersection. Is there any helper function in or any other lib we can use to calculate those huge matrices?
like β =

xa − xe xa − xc xd
ya − ye ya − yc yd
za − ze za − zc zd divide by

|A|

Error on read_json.h

I get this error from read_json,h when I run make in linux. I have not changed/edited/added any code! Is there a way to fix this?

computer-graphics-ray-casting/include/read_json.h:94:22: error: converting to ‘std::tuple<Eigen::Matrix<double, 3,
1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1> >’ from initializer list would use explicit constructor ‘constexpr std::tuple< >::tuple(_UElements&& ...) [with _UElements = {Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>};
= void; _Elements = {Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>}]’
tri->corners = {
^
computer-graphics-ray-casting/include/read_json.h:121:24: error: converting to ‘std::tuple<Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1> >’ from initializer list would use explicit constructor ‘constexpr std::tuple< >::tuple(_UElements&& ...) [with _UElements = {Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>}; = void; _Elements = {Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1>}]’
tri->corners = {

triangle has never been called.

I write a std::cout << "triangle intersect called" at the beginning of the function in order to test.
But After I run ./raycasting ..data/triangle.json nothing shows up in command window.
The plane and sphere work well.

Deprecated warnings in readstl.h for VS users

When I tried to compile this project by using Visual Studio 2015, I encountered some deprecated warnings that broke compiling. It seems because some CRT related calls, e.g. fopen, sscanf and so on, have been deprecated and VS cannot continue to compile.

One workaround that works for me without making any change of readstl.h is to add configuration item "_CRT_SECURE_NO_DEPRECATE" to "Project Properties -> Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions".

Just for VS users reference.

Correct output for sphere-and-plane and two-spheres-and-plane but no spheres on sphere-packing

On sphere-packing, my ppm output is just the background colour. So all red for id, all dark gray for depth and the light lilac colour for normal.
ex.
image

But my sphere-and-plane and my two-spheres-and-plane look exactly like the photos provided. I'm not sure if my inside-sphere is correct as there were no inside-sphere photos to reference but this is what I'm getting for the inside
image

If I remove the plane from the json file, then I just get an all black ppm image.

Bunny and triangle are working fine as well, so I'm assuming that it might be a problem with the Sphere file, but if so, why are the other sphere images working fine?

Update: I tried adding a sphere to the two-spheres-and-plane json file to see if it was a problem with overlapping spheres but it rendered fine as well? I'm really not sure why sphere-packing is not showing anything except for the background
image

Infinite Intersection

For a plane/triangle, can we assume that there will be no ray that lies on it, meaning that there are infinitely many intersection points?

what is min_t?

In every intersection function, I know how to compute $t$ but I don't understand what is min_t and how to use it. Can someone explain it. Thanks! (๑¯∀¯๑)
I know in .h file it's description is "minimum t value to consider (for viewing rays, this is typically at least the parametric distance of the image plane to the camera)".

make command not executing out of the box due to json.hpp

After running "make" from the build folder after doing cmake, I'm getting a large number of issues from the Javascript files. Can anyone advise? I'm working on the ECF machines, and I'm thinking it might be a compiler issue.

Here's the results of cmake in the build folder:
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Failed
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /u/c/sissonde/computer-graphics-ray-casting/build

And here's make:
Scanning dependencies of target raycasting
[ 12%] Building CXX object CMakeFiles/raycasting.dir/src/write_ppm.cpp.o
[ 25%] Building CXX object CMakeFiles/raycasting.dir/src/Plane.cpp.o
[ 37%] Building CXX object CMakeFiles/raycasting.dir/src/Sphere.cpp.o
[ 50%] Building CXX object CMakeFiles/raycasting.dir/src/TriangleSoup.cpp.o
[ 62%] Building CXX object CMakeFiles/raycasting.dir/src/viewing_ray.cpp.o
[ 75%] Building CXX object CMakeFiles/raycasting.dir/src/first_hit.cpp.o
[ 87%] Building CXX object CMakeFiles/raycasting.dir/src/Triangle.cpp.o
[100%] Building CXX object CMakeFiles/raycasting.dir/main.cpp.o
In file included from /u/c/sissonde/computer-graphics-ray-casting/include/read_json.h:24,
from /u/c/sissonde/computer-graphics-ray-casting/main.cpp:6:
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:129:14: error: #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
In file included from /u/c/sissonde/computer-graphics-ray-casting/include/read_json.h:24,
from /u/c/sissonde/computer-graphics-ray-casting/main.cpp:6:
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:110: error: expected nested-name-specifier before ‘json’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:110: error: ‘json’ has not been declared
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:110: error: expected ‘;’ before ‘=’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:110: error: expected unqualified-id before ‘=’ token
In file included from /u/c/sissonde/computer-graphics-ray-casting/include/read_json.h:24,
from /u/c/sissonde/computer-graphics-ray-casting/main.cpp:6:
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:271: error: expected unqualified-id before ‘using’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:274: error: expected unqualified-id before ‘using’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:281: error: expected nested-name-specifier before ‘type’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:281: error: using-declaration for non-member at class scope
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:281: error: expected ‘;’ before ‘=’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:281: error: expected unqualified-id before ‘=’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:282: error: expected nested-name-specifier before ‘value_type’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:282: error: using-declaration for non-member at class scope
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:282: error: expected ‘;’ before ‘=’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:282: error: expected unqualified-id before ‘=’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:283: error: ‘constexpr’ does not name a type
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:305: error: expected unqualified-id before ‘using’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:343: error: expected ‘;’ before ‘bool’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:344: error: expected ‘;’ before ‘bool’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:345: error: expected ‘;’ before ‘bool’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:346: error: expected ‘;’ before ‘bool’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:354: error: expected ‘;’ before ‘auto’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:365: error: expected ‘;’ before ‘auto’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:373: error: declaration of ‘auto nlohmann::detail::is_compatible_object_type<BasicJsonType, CompatibleObjectType>::constexpr’ has no initializer
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:373: error: expected ‘;’ before ‘value’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:383: error: declaration of ‘auto nlohmann::detail::is_compatible_string_type<BasicJsonType, CompatibleStringType>::constexpr’ has no initializer
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:383: error: expected ‘;’ before ‘value’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:392: error: declaration of ‘auto nlohmann::detail::is_basic_json_nested_type<BasicJsonType, T>::constexpr’ has no initializer
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:392: error: expected ‘;’ before ‘value’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:401: error: declaration of ‘auto nlohmann::detail::is_compatible_array_type<BasicJsonType, CompatibleArrayType>::constexpr’ has no initializer
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:401: error: expected ‘;’ before ‘value’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:419: error: expected nested-name-specifier before ‘RealLimits’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:419: error: using-declaration for non-member at class scope
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:419: error: expected ‘;’ before ‘=’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:419: error: expected unqualified-id before ‘=’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:420: error: expected nested-name-specifier before ‘CompatibleLimits’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:420: error: using-declaration for non-member at class scope
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:420: error: expected ‘;’ before ‘=’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:420: error: expected unqualified-id before ‘=’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:422: error: expected ‘;’ before ‘auto’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:431: error: expected ‘;’ before ‘auto’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:444: error: expected type-specifier before ‘enable_if_t’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:444: error: expected ‘>’ before ‘enable_if_t’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:450: error: expected ‘;’ before ‘bool’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:462: error: expected type-specifier before ‘enable_if_t’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:462: error: expected ‘>’ before ‘enable_if_t’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:468: error: expected ‘;’ before ‘bool’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:477: error: ‘uncvref_t’ was not declared in this scope
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:477: error: ‘uncvref_t’ was not declared in this scope
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:477: error: expected primary-expression before ‘>’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:477: error: ‘::to_json’ has not been declared
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:478: error: ‘declval’ is not a member of ‘std’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:478: error: expected primary-expression before ‘&’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:478: error: expected primary-expression before ‘>’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:478: error: expected primary-expression before ‘)’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:478: error: ‘declval’ is not a member of ‘std’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:478: error: expected primary-expression before ‘>’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:478: error: expected primary-expression before ‘)’ token
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:483: error: expected ‘;’ before ‘bool’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:490: error: expected ‘;’ before ‘bool’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:508: error: ‘constexpr’ does not name a type
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:512: error: expected constructor, destructor, or type conversion before ‘T’
In file included from /u/c/sissonde/computer-graphics-ray-casting/include/read_json.h:24,
from /u/c/sissonde/computer-graphics-ray-casting/main.cpp:6:
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:563: error: expected ‘;’ before ‘noexcept’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:569: error: expected ‘;’ before ‘const’
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp: In static member function ‘static std::string nlohmann::detail::exception::name(const std::string&, int)’:
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:576: error: call of overloaded ‘to_string(int&)’ is ambiguous
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2604: note: candidates are: std::string std::to_string(long long int)
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2610: note: std::string std::to_string(long long unsigned int)
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2616: note: std::string std::to_string(long double)
In file included from /u/c/sissonde/computer-graphics-ray-casting/include/read_json.h:24,
from /u/c/sissonde/computer-graphics-ray-casting/main.cpp:6:
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp: In static member function ‘static nlohmann::detail::parse_error nlohmann::detail::parse_error::create(int, size_t, const std::string&)’:
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:641: error: call of overloaded ‘to_string(size_t&)’ is ambiguous
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2604: note: candidates are: std::string std::to_string(long long int)
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2610: note: std::string std::to_string(long long unsigned int)
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2616: note: std::string std::to_string(long double)
In file included from /u/c/sissonde/computer-graphics-ray-casting/include/read_json.h:24,
from /u/c/sissonde/computer-graphics-ray-casting/main.cpp:6:
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp: At global scope:
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:911: error: expected initializer before ‘noexcept’
In file included from /u/c/sissonde/computer-graphics-ray-casting/include/read_json.h:24,
from /u/c/sissonde/computer-graphics-ray-casting/main.cpp:6:
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:18570: error: expected ‘}’ before end of line
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:18570: error: expected ‘}’ before end of line
/u/c/sissonde/computer-graphics-ray-casting/shared/cmake/../json/json.hpp:18570: error: expected declaration before end of line
make[2]: *** [CMakeFiles/raycasting.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/raycasting.dir/all] Error 2
make: *** [all] Error 2

As expected, the error is coming from main.cpp's include statement to read_json.cpp's line which includes "json.hpp" in the json folder. No changes have been made to the program.

I'm not sure how to proceed, does anyone have ideas?

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.