-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathDemoHemisphere01.kt
35 lines (31 loc) · 1.01 KB
/
DemoHemisphere01.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package spatial
import org.openrndr.WindowMultisample
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.DrawPrimitive
import org.openrndr.extra.camera.Orbital
import org.openrndr.extra.color.presets.SADDLE_BROWN
import org.openrndr.extra.objloader.loadOBJasVertexBuffer
import org.openrndr.extra.shadestyles.spatial.HemisphereLight
import org.openrndr.math.Vector3
fun main() {
application {
configure {
width = 720
height = 720
multisample = WindowMultisample.SampleCount(8)
}
program {
val obj = loadOBJasVertexBuffer("demo-data/obj-models/suzanne/Suzanne.obj")
extend(Orbital()) {
eye = Vector3(0.0, 0.0, 2.0)
}
extend {
drawer.shadeStyle = HemisphereLight().apply {
downColor = ColorRGBa.SADDLE_BROWN
}
drawer.vertexBuffer(obj, DrawPrimitive.TRIANGLES)
}
}
}
}