Added scene4.json

This commit is contained in:
2017-01-18 23:07:41 -04:00
parent c242824f71
commit e99d390aab
2 changed files with 30 additions and 96 deletions

View File

@@ -181,100 +181,4 @@
vl.push_back(static_cast<Light *>(l)); vl.push_back(static_cast<Light *>(l));
} }
void scene_3(vector<Figure *> & vf, vector<Light *> & vl, Environment * & e, Camera * c) {
Sphere * s;
Disk * d;
// SpotLight * l;
// DirectionalLight * l2;
vec3 eye = vec3(0.0f, 1.5f, 1.0f);
vec3 center = vec3(0.0f, 0.0f, -2.0f);
vec3 left = vec3(-1.0f, 0.0f, 0.0f);
e = new Environment("textures/pisa.hdr");
c->m_eye = eye;
c->m_look = center;
c->m_up = cross(normalize(center - eye), left);
c->translate(vec3(1.0f, 0.0f, 0.0f));
//c->roll(15.0f);
// s = new Sphere(0.0f, -0.15f, -2.0f, 1.0f);
// s->m_mat->m_diffuse = vec3(1.0f, 0.5f, 0.0f);
// s->m_mat->m_specular = vec3(0.3f);
// s->m_mat->m_shininess = 5.0f;
// s->m_mat->m_rho = 0.4f;
// s->m_mat->m_refract = true;
// s->m_mat->m_ref_index = 1.33f;
// vf.push_back(static_cast<Figure *>(s));
// s = new Sphere(0.0f, -0.15f, -2.0f, 0.5f);
// s->m_mat->m_diffuse = vec3(0.0f);
// s->m_mat->m_specular = vec3(0.0f);
// s->m_mat->m_rho = 0.0f;
// s->m_mat->m_refract = true;
// s->m_mat->m_ref_index = 2.6f;
// vf.push_back(static_cast<Figure *>(s));
s = new Sphere(2.0f, 0.0f, -2.0f, 1.5f, new HeidrichSeidelAnisotropicBRDF(vec3(0.0f, 1.0f, 0.0f)));
s->m_mat->m_diffuse = vec3(1.0f, 1.0f, 0.0f);
s->m_mat->m_shininess = 128.0f;
vf.push_back(static_cast<Figure *>(s));
s = new Sphere(-1.0f, 0.0f, -3.25f, 1.5f);
s->m_mat->m_diffuse = vec3(1.0f, 0.0f, 1.0f);
s->m_mat->m_rho = 0.4f;
vf.push_back(static_cast<Figure *>(s));
s = new Sphere(1.0f, 0.0f, -3.25f, 1.5f);
s->m_mat->m_diffuse = vec3(1.0f);
s->m_mat->m_rho = 0.4f;
vf.push_back(static_cast<Figure *>(s));
d = new Disk(vec3(1.0f, -1.5f, -3.25f), vec3(0.0f, 1.0f, 0.0f), 3.0f);
d->m_mat->m_diffuse = vec3(0.0f, 0.5f, 0.5f);
d->m_mat->m_specular = vec3(0.0f);
vf.push_back(static_cast<Figure *>(d));
// l = new SpotLight();
// l->m_position = normalize(vec3(-2.0f, 1.5f, -1.0f));
// l->m_diffuse = vec3(1.0f, 1.0f, 0.0f);
// l->m_spot_dir = normalize(vec3(0.5f, 0.0f, -2.5f) - vec3(-2.0f, 1.5f, -1.0f));
// l->m_spot_cutoff = 89.0f;
// l->m_spot_exponent = 10.0f;
// vl.push_back(static_cast<Light *>(l));
// l2 = new DirectionalLight();
// l2->m_position = normalize(vec3(-1.0f, 0.7f, 1.0f));
// l2->m_diffuse = vec3(1.0f, 1.0f, 1.0f);
// vl.push_back(static_cast<Light *>(l2));
// l2 = new DirectionalLight();
// l2->m_position = normalize(vec3(-0.5f, 0.7f, 1.0f));
// l2->m_diffuse = vec3(0.0f, 0.0f, 1.0f);
// l2->m_specular = vec3(0.0f, 0.0f, 1.0f);
// vl.push_back(static_cast<Light *>(l2));
// l = new DirectionalLight();
// l->m_position = normalize(vec3(1.0f, 0.0f, 1.0f));
// l->m_diffuse = vec3(0.5f);
// vl.push_back(static_cast<Light *>(l));
}
void scene_4(vector<Figure *> & vf, vector<Light *> & vl, Environment * & e, Camera * c) {
Sphere * s;
Plane * p;
e = new Environment("textures/pisa.hdr");
s = new Sphere(0.0f, 0.0f, -2.0f, 1.0f);
s->m_mat->m_diffuse = vec3(1.0f);
s->m_mat->m_rho = 0.3f;
vf.push_back(static_cast<Figure *>(s));
p = new Plane(vec3(0.0f, -1.0f, 0.0f), vec3(0.0f, 1.0f, 0.0f));
p->m_mat->m_diffuse = vec3(1.0f);
p->m_mat->m_specular = vec3(0.0f);
vf.push_back(static_cast<Figure *>(p));
}
#+END_SRC #+END_SRC

30
scenes/scene4.json Normal file
View File

@@ -0,0 +1,30 @@
{
"environment": {
"texture": "textures/pisa.hdr",
"light_probe": false
},
"camera": {
"eye": [0.0, 1.0, 0.0],
"look": [0.0, 0.0, -2.0],
"up": [0.0, 1.0, 0.0]
},
"sphere": {
"position": [0.0, 0.0, -2.0],
"radius": 1.0,
"material": {
"diffuse": [0.5, 0.5, 0.5],
"rho": 1.0
}
},
"plane": {
"position": [0.0, -1.0, 0.0],
"normal": [0.0, 1.0, 0.0],
"material": {
"diffuse": [0.0, 0.5, 1.0],
"specular": [0.0, 0.0, 0.0]
}
}
}