Skip to content

Commit

Permalink
Fix lights
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitvarkey committed Oct 20, 2015
1 parent e657e03 commit 732986c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/container.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function compose!(a::Context, b::Material)
end

function compose!(a::Context, b::Light)
a.container_children = cons(b, a.light_children)
a.light_children = cons(b, a.light_children)
return a
end

Expand Down
9 changes: 3 additions & 6 deletions src/patchable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -270,29 +270,26 @@ function draw(img::Patchable3D, parent_box::AbsoluteBox, light::Light)
end

function draw(img::Patchable3D, light::AmbientLight)
color = string("#" * hex(light.color))
ThreeJS.ambientlight(color)
ThreeJS.ambientlight(light.color)
end

function draw(img::Patchable3D, light::PointLight)
color = string("#" * hex(light.color))
ThreeJS.pointlight(
light.position[1].value,
light.position[2].value,
light.position[3].value,
color=color,
color=light.color,
intensity=light.intensity,
distance=light.distance.value,
)
end

function draw(img::Patchable3D, light::SpotLight)
color = string("#" * hex(light.color))
ThreeJS.spotlight(
light.position[1].value,
light.position[2].value,
light.position[3].value,
color=color,
color=light.color,
intensity=light.intensity,
distance=light.distance.value,
angle=light.angle,
Expand Down

0 comments on commit 732986c

Please sign in to comment.