Skip to content

Commit

Permalink
added simple scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinedev committed Apr 4, 2023
1 parent ed98302 commit 9df8190
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ using namespace std;
Controller::Controller(istream& scenegraphFile, Model& m,View& v): model(m), view(v) {
initScenegraph(scenegraphFile);

globalCamera = new StationaryCamera(glm::vec3(0.0, 0.0, 100.0));
globalCamera = new StationaryCamera(glm::vec3(0.0, 0.0, 20.0));
globalCamera->LookAt(glm::vec3(0.0,0.0,0.0));
cameras.push_back(globalCamera);

Expand Down
9 changes: 9 additions & 0 deletions scenegraphmodels/box.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@ specular 1 0 0
shininess 0
end-material

light globalLight
ambient 0.3 0.3 0.3
diffuse 0.4 0.4 0.4
specular 0.6 0.6 0.6
position 2 2 2
end-light


#the root
group node-1-0 root
scale node-2-0 scale 10 10 10
assign-light node-2-0 globalLight
leaf node-3-0 one-box instanceof box #comment here?

assign-material node-3-0 mat-node-3-0
Expand Down
31 changes: 31 additions & 0 deletions scenegraphmodels/sphere.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#all the instances
instance sphere models/sphere.obj

#material
material mat-node-3-0
emission 0 0 0
ambient 1 0 0
diffuse 1 0 0
specular 1 0 0
shininess 0
end-material

light globalLight
ambient 0.3 0.3 0.3
diffuse 0.4 0.4 0.4
specular 0.6 0.6 0.6
position 2 2 2
end-light


#the root
group node-1-0 root
scale node-2-0 scale 5 5 5
assign-light node-2-0 globalLight
leaf node-3-0 one-sphere instanceof sphere #comment here?

assign-material node-3-0 mat-node-3-0
add-child node-3-0 node-2-0
add-child node-2-0 node-1-0
assign-root node-1-0

0 comments on commit 9df8190

Please sign in to comment.