Skip to content

Commit

Permalink
out
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Jun 10, 2018
1 parent 1d6e50a commit 984c03c
Show file tree
Hide file tree
Showing 27 changed files with 481 additions and 35 deletions.
17 changes: 2 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,6 @@ https://avik-das.github.io/build-your-own-raytracer/

## Getting Started

This uses webpack for the build process.
As of lesson 1, there is no `webpack.config.js`, just run webpack since
`index.js` is in `src/` and the default build of `dist/main.js` works.
Clone this repository and from it run `npm i`.

## Progress

- [x] Lesson 1
- [x] Lesson 2
- [x] Lesson 3
- [x] Lesson 4
- [x] Lesson 5
- [x] Lesson 6
- [x] Create Visible Light Sources
- [x] Try with bigger image
- [x] Try skewed camera
- [ ]
Create 8 solar system images with `node src/index.js SolarSystem`.
27 changes: 24 additions & 3 deletions data/components/Colors.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@

Blue:
size: .5
ambient: [0, 0, .3]
diffuse: [0, 0, 1]
spec: [.2, .2, .5]
shine: 5

Gray:
size: .5
ambient: [.3, .3, .3]
diffuse: [.5, .5, .5]
spec: [.5, .5, .5]
shine: 5

LimeGreen:
size: .5
ambient: [.2, .3, .2]
diffuse: [.2, .8, .2]
spec: [.2, .5, .2]
shine: 5
Gray:

Red:
size: .5
ambient: [.3, 0, 0]
diffuse: [1, 0, 0]
spec: [.5, .2, .2]
shine: 5

S-White:
size: .2
ambient: [.3, .3, .3]
diffuse: [.5, .5, .5]
diffuse: [1, 1, 1]
spec: [.5, .5, .5]
shine: 5
6 changes: 3 additions & 3 deletions data/components/Lights.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ RedLight:
Flame:
isLight: true
light:
diffuse: [1, 0, 0]
spec: [1, 0, 0]
size: 1
diffuse: [1, .8, 0]
spec: [1, 1, 1]
size: .2
7 changes: 7 additions & 0 deletions data/components/Shoes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

WoodenShoe:
size: .2
ambient: [.5, .4, .2]
diffuse: [0.59, 0.44, .2]
spec: [.5, .44, .2]
shine: 5
32 changes: 32 additions & 0 deletions data/objects/Characters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

importComponents:
- Colors
- Shoes

define:
MainCharacter:
place:
- name: LeftShoe
obj: Shoes.WoodenShoe
loc: [0, .7, .3]
- name: RightShoe
obj: Shoes.WoodenShoe
loc: [0, .7, -0.3]
- name: LowerBody
obj: Colors.Blue
loc: [0, 1.2, 0]
- name: UpperBody
obj: Colors.Red
loc:
from: LowerBody
dir: [0, .7, 0]
- name: LeftHand
obj: Colors.S-White
loc:
from: UpperBody
dir: [0, 0, .7]
- name: RightHand
obj: Colors.S-White
loc:
from: UpperBody
dir: [0, 0, -0.7]
24 changes: 23 additions & 1 deletion data/objects/Lights.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@

importComponents:
- Lights
- Lights
- Nature

define:
Flame:
place:
- name: Light
obj: Lights.Flame
loc: [0, 1, 0]
Torch:
place:
- name: Stick
obj: Nature.Stick
loc: [0, .6, 0]
- name: Stick
obj: Nature.Stick
loc:
from: Stick
dir: [0, .2, 0]
- name: Stick
obj: Nature.Stick
loc:
from: Stick
dir: [0, .2, 0]
- name: Fire
obj: Lights.Flame
loc:
from: Stick
dir: [0, .3, 0]

WhiteLight:
place:
- name: Light
Expand Down
7 changes: 0 additions & 7 deletions data/objects/SolarSystem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,4 @@ define:
from: Sun
random: [ [ -1, 1 ], [ 0, 0 ], [ -1, 1 ] ]
scale: [21, 0, 21]

- name: Mirror (Test)
obj: Utils.MirrorBall
loc:
from: Sun
random: [ [ -1, 1 ], [ 0, 0 ], [ -1, 1 ] ]
scale: [9, 0, 9]

139 changes: 139 additions & 0 deletions data/objects/Structures.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,147 @@

importComponents:
- Colors
- Nature

define:
XFence:
place:

- name: CenterPost
obj: Nature.Stick
loc: [0, .6, 0]
- name: CenterPostLower
obj: Nature.Stick
loc:
from: CenterPost
dir: [0, .2, 0]
- name: CenterPost
obj: Nature.Stick
loc:
from: CenterPostLower
dir: [0, .2, 0]
- name: CenterPostHigher
obj: Nature.Stick
loc:
from: CenterPost
dir: [0, .2, 0]
- name: CenterPost
obj: Nature.Stick
loc:
from: CenterPostHigher
dir: [0, .2, 0]

- name: LowerLeft
obj: Nature.Stick
loc:
from: CenterPostLower
dir: [-0.2, 0, 0]
- name: LowerLeft
obj: Nature.Stick
loc:
from: LowerLeft
dir: [-0.2, 0, 0]
- name: LowerRight
obj: Nature.Stick
loc:
from: CenterPostLower
dir: [0.2, 0, 0]
- name: LowerRight
obj: Nature.Stick
loc:
from: LowerRight
dir: [0.2, 0, 0]

- name: UpperLeft
obj: Nature.Stick
loc:
from: CenterPostHigher
dir: [-0.2, 0, 0]
- name: UpperLeft
obj: Nature.Stick
loc:
from: UpperLeft
dir: [-0.2, 0, 0]
- name: UpperRight
obj: Nature.Stick
loc:
from: CenterPostHigher
dir: [0.2, 0, 0]
- name: UpperRight
obj: Nature.Stick
loc:
from: UpperRight
dir: [0.2, 0, 0]

ZFence:
place:

- name: CenterPost
obj: Nature.Stick
loc: [0, .6, 0]
- name: CenterPostLower
obj: Nature.Stick
loc:
from: CenterPost
dir: [0, .2, 0]
- name: CenterPost
obj: Nature.Stick
loc:
from: CenterPostLower
dir: [0, .2, 0]
- name: CenterPostHigher
obj: Nature.Stick
loc:
from: CenterPost
dir: [0, .2, 0]
- name: CenterPost
obj: Nature.Stick
loc:
from: CenterPostHigher
dir: [0, .2, 0]

- name: LowerClose
obj: Nature.Stick
loc:
from: CenterPostLower
dir: [0, 0, -0.2]
- name: LowerClose
obj: Nature.Stick
loc:
from: LowerClose
dir: [0, 0, -0.2]
- name: LowerFar
obj: Nature.Stick
loc:
from: CenterPostLower
dir: [0, 0, 0.2]
- name: LowerFar
obj: Nature.Stick
loc:
from: LowerFar
dir: [0, 0, 0.2]

- name: UpperClose
obj: Nature.Stick
loc:
from: CenterPostHigher
dir: [0, 0, -0.2]
- name: UpperClose
obj: Nature.Stick
loc:
from: UpperClose
dir: [0, 0, -0.2]
- name: UpperFar
obj: Nature.Stick
loc:
from: CenterPostHigher
dir: [0, 0, 0.2]
- name: UpperFar
obj: Nature.Stick
loc:
from: UpperFar
dir: [0, 0, 0.2]

XWall:
place:
- name: Bottom
Expand Down
64 changes: 64 additions & 0 deletions data/scenes/Demo1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

importObjects:
- Characters
- Lights
- Plants
- SingleSpheres
- Structures

layTurf:
type: grass
x: 10
z: 10

place:

- name: Light
obj: Lights.WhiteLight
loc: [ 0, 10, 3 ]

- name: MainCharacter
obj: Characters.MainCharacter
loc: [0, 0, 0]

- name: Torch
obj: Lights.Torch
loc: [-3, 0, -3]

- name: Tree
obj: Plants.Tree
loc: [-3, 0, 0]

- name: SilverBall
obj: SingleSpheres.SilverStone
loc: [-3, 0, 3]

- name: Fencing
obj: Structures.XFence
loc: [0, 0, -3]

- name: Fencing
obj: Structures.XFence
loc: [1, 0, -3]

- name: Fencing
obj: Structures.XFence
loc: [2, 0, -3]

- name: Fencing
obj: Structures.ZFence
loc: [0, 0, -3]

- name: Fencing
obj: Structures.ZFence
loc: [0, 0, -2]

- name: Fencing
obj: Structures.ZFence
loc: [0, 0, -1]

- name: SilverBall
obj: SingleSpheres.SilverStone
loc: [3, 0, 3]

pictures: 6
Loading

0 comments on commit 984c03c

Please sign in to comment.