-
大小: 1013KB文件类型: .rar金币: 1下载: 0 次发布日期: 2023-09-20
- 语言: 其他
- 标签: ray_tracing ground_up shadow
资源简介
《Ray Tracing from the Ground Up》, chapter16, shadow。所有代码移植到Codeblocks。同时包含个人的测试图形。
代码片段和文件信息
#define testNumber 46
/*
1: output the first image
2: test “int &ri,int& ri,int *&pri“
3: output the first image by using vector.
4: test the class “vec3“
5: test the function “inline vec3& vec3::operator+=(const vec3 &v)“
6: test rays
7: test rays and add a sphere
8: visualize the normals of sphere.
9: several spheres
10: abstract class
11: antialiasing
12: diffuse materials
13: metal
14: dielectric
15: positionable camera and defocus blur
16: random scene
17: ray/box intersection
18: triangle
19: polygon
20: box
21: linear equation
22: get_vector_v
23: box2()
24: any box
25: ellipsoid
26: inverse mapping
27: find the roots of quartic equation
28: tori
29: cylinder all
30: get_vector_vw()
31: tori_part_all
32: acos(z_n u_xoz)
33: quartic_blend_cylinder
34: superellipsoid
35: rain
36: parametric surface
37: matrix
38: read file
39: translational sweeping
40: roots number of equation of 6th degree or 10th degree
41: rotational sweeping
42: sphere sweeping
43: binary tree
44: binary tree 2
45: intervals
46: CSG
*/
#if testNumber == 1 /*1: output the first image*/
#include
#include
using namespace std;
int main()
{
int nx = 200;
int ny = 100;
ofstream outfile( “.\\results\\FirstImage.txt“ ios_base::out);
outfile << “P3\n“ << nx << “ “ << ny << “\n255\n“;
std::cout << “P3\n“ << nx << “ “ << ny << “\n255\n“;
for (int j = ny-1; j >= 0; j--)
{
for (int i = 0; i < nx; i++)
{
float r = float(i) / float(nx);
float g = float(j) / float(ny);
float b = 0.2;
int ir = int (255.99*r);
int ig = int (255.99*g);
int ib = int (255.99*b);
outfile << ir << “ “ << ig << “ “ << ib << “\n“;
std::cout << ir << “ “ << ig << “ “ << ib << “\n“;
}
}
}
#elif testNumber == 2 /*2: test “int &ri,int& ri,int *&pri“*/
#include
using namespace std;
int main()
{
int ival = 111;
int *pi1 = &ival;
cout << “int *pi1 = &ival--pi1:“ << pi1 << “--*pi1:“ << *pi1 << “--&pi1:“ << &pi1 << endl;
int* pi2 = &ival;
cout << “int* pi2 = &ival--pi2:“ << pi2 << “--*pi2:“ << *pi2 << “--&pi2:“ << &pi2 << endl;
int * pi3 = &ival;
cout << “int * pi3 = &ival--pi3:“ << pi3 << “--*pi3:“ << *pi3 << “--&pi3:“ << &pi3 << endl << endl;
int &ri1 = ival;
cout << “int &ri1 = ival--ri1:“ << ri1 << “--*ri1:(error)“ << “--&ri1:“ << &ri1 << endl;
int& ri2 = ival;
cout << “int& ri2 = ival--ri2:“ << ri2 << “--*ri2:(error)“ << “--&ri2:“ << &ri2 << endl;
int & ri3 = ival;
cout << “int & ri3 = ival--ri3:“ << ri3 << “--*ri3:(error)“ << “--&ri3:“ << &ri3 << endl << endl;
int * const &pr1 = &ival;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 0 2016-12-03 10:47 mytest\bin\Debug\2.txt
文件 114702 2016-09-30 04:03 mytest\bin\Debug\cb_console_runner.exe
文件 2381963 2017-02-03 11:13 mytest\bin\Debug\mytest.exe
文件 973 2016-12-27 23:31 mytest\include\blobs.h
文件 743 2017-02-02 09:27 mytest\include\box.h
文件 1460 2016-12-05 10:16 mytest\include\box2.h
文件 1288 2016-11-25 09:47 mytest\include\camera.h
文件 922 2017-02-03 11:02 mytest\include\csgTree.h
文件 376 2016-11-23 11:44 mytest\include\dielectric.h
文件 799 2016-12-11 10:59 mytest\include\elliptic_plane.h
文件 547 2017-02-01 20:43 mytest\include\hitable.h
文件 388 2016-11-19 11:26 mytest\include\hitable_list.h
文件 369 2016-12-10 11:17 mytest\include\lambertian.h
文件 995 2017-01-20 18:17 mytest\include\log.h
文件 242 2016-12-10 11:39 mytest\include\material.h
文件 424 2016-11-23 11:04 mytest\include\me
文件 4297 2017-01-10 13:29 mytest\include\parametric_surface.h
文件 401 2016-12-01 19:08 mytest\include\polygon.h
文件 954 2016-12-15 13:45 mytest\include\quadratic.h
文件 1037 2016-12-15 13:57 mytest\include\quadratic_cylinder_all.h
文件 686 2016-12-18 22:57 mytest\include\quadratic_ellipsoid.h
文件 784 2016-12-15 13:46 mytest\include\quadratic_hyperbolic_paraboloid.h
文件 685 2016-12-15 13:46 mytest\include\quadratic_paraboloid.h
文件 1087 2016-12-17 22:52 mytest\include\quartic_blend_cylinder.h
文件 673 2016-12-28 20:17 mytest\include\rain.h
文件 562 2017-01-20 18:20 mytest\include\ray.h
文件 515 2017-02-01 20:46 mytest\include\sphere.h
文件 899 2016-12-22 14:57 mytest\include\superellipsoid.h
文件 1260 2016-12-25 12:05 mytest\include\superhyperboloid.h
文件 719 2016-12-19 23:26 mytest\include\superquadratic.h
............此处省略118个文件信息
相关资源
- raytracegroundup_transplant1_picturechapter15_
- Shadow Defender 中文 汉化版+ 序列号
- ShadowMap_PCF
- D3D11_ShadowMap1
- ShadowsocksR-win-4.9.0-副本.zip
- directx写的阴影源码
- Real-Time Shadows实时阴影技术
- Ray Tracing Gems-High-Quality and Real-Time Re
- Ray Tracing from the Ground Up 光跟踪算法技
- Shadowrocket-2.1.10(501).zip
- Shadowrocket.zip
- Shadowrocket_2.1.12.zip
- IOS最新版Shadowrocket.rar
- Shadowrocketv2.1.21.ipa
- GPU Pro 360 Guide to Shadows-Wolfgang Engel-20
- EasyAR 显示阴影Shader
- shadowsocks-libev_2.5.5-1_amd64_Ubuntu14.04.de
- OGLShadow阴影基础
- 使用Qt实现的阴影映射源代码
- 2DDL Pro 2D Dynamic Lights and Shadows v1.4.13
- Shader实现的阴影效果(Shadow)
- ray tracing in one weekend
- 光线追踪RayTracer源码(基于OpenGL)
- Moonlight Shadow.mp3
- raytracegroundup_transplant1_chapter14_2017021
评论
共有 条评论