Skip to content

Commit

Permalink
make example a bit more obvious with light
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Jul 19, 2023
1 parent f39b8ce commit 58857e3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions docs/examples/plotting_functions/mesh.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ scene = mesh(vertices, faces, color = colors, shading = false)

\begin{examplefigure}{}
```julia
using GLMakie
using Makie.GeometryBasics: GeometryBasics, GLTriangleFace
GLMakie.activate!() # hide

vertices = Point3f[
(cosd(0), sind(0), 0),
(cosd(120), sind(120), 0),
Expand All @@ -57,13 +53,12 @@ msh = GeometryBasics.Mesh(vertices, faces) # mesh without normals
normal_msh = GeometryBasics.normal_mesh(msh) # explicitely create mesh with normals

colors = [:red, :green, :blue, :orange]

# Axis3 currently doesn't support setting lights, so we just change them in the theme!
set_theme!(lightposition=Vec3f(1, -1, 2), ambient=RGBf(0.2, 0.2, 0.2))
f = Figure()

# normals get generated automatically in the meshcall in both cases, since [email protected]
mesh(f[1, 1], msh; color=colors, axis=(; type=Axis3, aspect=:data, title="No shading"), shading=false)
mesh(f[2, 1], normal_msh; color=colors, axis=(; type=Axis3, aspect=:data, title="Automatic normals"))

f
```
\end{examplefigure}
Expand Down

0 comments on commit 58857e3

Please sign in to comment.