์๋์ฐ 11 ํ๊ฒฝ์์ IntelliJ IDEA๋ฅผ ํ์ฉํด OPENRNDR ๊ฐ๋ฐ ํ๊ฒฝ์ ๊ตฌ์ถํ๋ ๊ณผ์ ์ ๋๋ค.
OPENRNDR๋ Kotlin ๋ฐ JVM ๊ธฐ๋ฐ ํ๋ ์์ํฌ์ด๋ฏ๋ก, ๋ณ๋๋ก ์๋ ๋น๋ ์ค์ ์ ํ ํ์ ์์ด ๊ณต์ ์ ๊ณต ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํ ํ๋ฆฟ Repository๋ฅผ ๊ฐ์ ธ์ Gradle์ด ๋น๋ํ๋๋ก ๊ตฌ์ฑํ๋ ๋ฐฉ์์ด ๊ฐ์ฅ ํจ์จ์ ์ ๋๋ค.
.exe)์ ์คํํฉ๋๋ค.OPENRNDR ๊ณต์ ํ ํ๋ฆฟ์๋ ํ์ Gradle ์ค์ ๊ณผ ๊ธฐ๋ณธ ์์กด์ฑ์ด ๋ฏธ๋ฆฌ ๊ตฌ์ฑ๋์ด ์์ต๋๋ค.
File > New > Project from Version Control... ์ ํ)https://github.com/openrndr/openrndr-template.git
File > Project Structure > Project ์ด๋Reload All Gradle Projects ๋ฒํผ์ ๋๋ฌ ๋๊ธฐํ๋ฅผ ์๋ฃํฉ๋๋ค.src/main/kotlin/TemplateProgram.ktimport org.openrndr.application
import org.openrndr.color.ColorRGBa
fun main() = application {
configure {
width = 640
height = 480
}
program {
extend {
drawer.clear(ColorRGBa.PINK)
}
}
}
fun main() ์ฝ๋ ์ค ๋ฐ๋ก ์์ ํ์๋๋ ์ด๋ก์ ์ฌ์ ์ผ๊ฐ ๋ฒํผ(โถ)์ ํด๋ฆญํ๊ณ Run 'TemplateProgramKt'๋ฅผ ์ ํํฉ๋๋ค.์ถ๊ฐ ๊ทธ๋ํฝ ๊ธฐ๋ฅ, ๋ฌผ๋ฆฌ ์ฐ์ฐ, UI ํจ๋, ๋ผ์ด๋ธ ์ฝ๋ฉ(orx-olive) ๊ธฐ๋ฅ์ ํ์ฉํ๋ ค๋ฉด ํ๋ก์ ํธ ๋ฃจํธ์ build.gradle.kts ํ์ผ์ ์ด๊ณ ์ฃผ์ ์ฒ๋ฆฌ๋์ด ์๋ orxFeatures ํญ๋ชฉ์ ์ฃผ์์ ํด์ ํ ํ Gradle Sync๋ฅผ ์งํํ๋ฉด ๋ฉ๋๋ค.
ํ ํ๋ฆฟ ์ ์ฅ์๋ฅผ ํด๋ก ํ์ง ์๊ณ ๊ธฐ์กด IntelliJ ํ๋ก์ ํธ๋ ์ Kotlin ํ๋ก์ ํธ์ OPENRNDR ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ต์ ์์กด์ฑ๋ง ์๋ ์ถ๊ฐํ์ฌ ๊ฐ๋ณ๊ฒ ์์ํ๋ ๋ฐฉ๋ฒ์ ๋๋ค.
OPENRNDR๋ C++ ๋ค์ดํฐ๋ธ ๊ทธ๋ํฝ ๋ผ์ด๋ธ๋ฌ๋ฆฌ(LWJGL ๋ฑ)๋ฅผ ํฌํจํ๋ฏ๋ก, Gradle ์ค์ ํ์ผ(build.gradle.kts)์ ์ค์ ๋ฆฌํฌ์งํ ๋ฆฌ์ ์ต์ ์์กด์ฑ 3๊ฐ(core, application, native binaries)๋ง ๋ช
์ํด ์ฃผ๋ฉด ๋ฉ๋๋ค.
openrndr-quickstart)build.gradle.kts) ์ ํbuild.gradle.kts ํ์ผ ์ค์ ํ๋ก์ ํธ ๋ฃจํธ ๋๋ ํฐ๋ฆฌ์ build.gradle.kts ํ์ผ์ ์ด๊ณ ๊ธฐ์กด ๋ด์ฉ์ ์๋์ ๊ฐ์ด ๊ต์ฒดํฉ๋๋ค.
plugins {
kotlin("jvm") version "1.9.22"
application
}
repositories {
mavenCentral()
maven("https://maven.openrndr.org")
}
// OPENRNDR ๋ฒ์ ๋ฐ ํ๋ซํผ ์ค์
val openrndrVersion = "0.4.3-RELEASE"
val openrndrOs = "windows"
dependencies {
// ์ฝ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ
implementation("org.openrndr:openrndr-core:$openrndrVersion")
implementation("org.openrndr:openrndr-application:$openrndrVersion")
implementation("org.openrndr:openrndr-color:$openrndrVersion")
// ์๋์ฐ 11 64bit ๋ค์ดํฐ๋ธ ๋ฐ์ธ๋ฉ
runtimeOnly("org.openrndr:openrndr-gl3-natives-\(openrndrOs:\)openrndrVersion")
runtimeOnly("org.openrndr:openrndr-openal-natives-\(openrndrOs:\)openrndrVersion")
// Kotlin ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฐ ์ฝ๋ฃจํด support
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
}
application {
mainClass.set("MainKt")
}
ํ์ผ ํธ์ง ํ IntelliJ ์ฐ์ธก ์๋จ์ ๋จ๋ Gradle ๋๊ธฐํ ์์ด์ฝ(์ฝ๋ผ๋ฆฌ ๋ชจ์ ๋ฒํผ)**์ ๋๋ฅด๊ฑฐ๋ Ctrl + Shift + O๋ฅผ ๋๋ฌ ๋ณ๊ฒฝ์ฌํญ์ ์ ์ฉํฉ๋๋ค.
src/main/kotlin/ ๊ฒฝ๋ก์ Main.kt ํ์ผ์ ์์ฑํฉ๋๋ค.import org.openrndr.application
import org.openrndr.color.ColorRGBa
fun main() = application {
configure {
width = 800
height = 600
title = "OPENRNDR Light Setup"
}
program {
extend {
// ๋ฐฐ๊ฒฝ์ ์ค์ (R, G, B)
drawer.clear(ColorRGBa(0.1, 0.1, 0.15))
// ์ค์์ ์ ๊ทธ๋ฆฌ๊ธฐ
drawer.fill = ColorRGBa(0.9, 0.4, 0.3)
drawer.circle(drawer.bounds.center, 150.0)
}
}
}
fun main() ์์ ์ด๋ก์ ์ฌ์ ์ผ๊ฐ ๋ฒํผ(โถ)์ ํด๋ฆญํ๊ณ Run 'MainKt'๋ฅผ ์คํํ๋ฉด ํ
ํ๋ฆฟ ํ๋ก์ ํธ ์์ด ์ต์ ํ๊ฒฝ์ผ๋ก ์ฐฝ์ด ๋ ๋๋ง๋ฉ๋๋ค.