Bumped to 0.0.18
Fixed triangle winding in orx-mesh-generators
This commit is contained in:
@@ -16,7 +16,7 @@ A growing library of assorted data structures, algorithms and utilities.
|
|||||||
- [`orx-obj-loader`](orx-obj-loader/README.md), simple Wavefront .obj mesh loader
|
- [`orx-obj-loader`](orx-obj-loader/README.md), simple Wavefront .obj mesh loader
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
ORX 0.0.16 is built against OPENRNDR 0.3.30, make sure you use this version in your project. Because OPENRNDR's API is pre 1.0 it tends to change from time to time.
|
ORX 0.0.18 is built against OPENRNDR 0.3.32, make sure you use this version in your project. Because OPENRNDR's API is pre 1.0 it tends to change from time to time.
|
||||||
|
|
||||||
The easiest way to add ORX to your project is through the use of Jitpack. [Jitpack](http://jitpack.io) is a service that pulls Gradle based libraries from Github, builds them and serves the jar files.
|
The easiest way to add ORX to your project is through the use of Jitpack. [Jitpack](http://jitpack.io) is a service that pulls Gradle based libraries from Github, builds them and serves the jar files.
|
||||||
|
|
||||||
@@ -30,13 +30,13 @@ repositories {
|
|||||||
You can then add any of the ORX artefacts to your `dependencies {}`:
|
You can then add any of the ORX artefacts to your `dependencies {}`:
|
||||||
```
|
```
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.github.openrndr.orx:<orx-artifact>:v0.0.16'
|
compile 'com.github.openrndr.orx:<orx-artifact>:v0.0.18'
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
For example if you want to use the `orx-no-clear` artifact one would use:
|
For example if you want to use the `orx-no-clear` artifact one would use:
|
||||||
```
|
```
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.github.openrndr.orx:orx-no-clear:v0.0.16'
|
compile 'com.github.openrndr.orx:orx-no-clear:v0.0.18'
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ plugins {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
group 'org.openrndr.extra'
|
group 'org.openrndr.extra'
|
||||||
version '0.0.16'
|
version '0.0.18'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -13,7 +13,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
openrndrVersion = "0.3.30"
|
openrndrVersion = "0.3.32-rc1"
|
||||||
}
|
}
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package org.openrndr.extra.jumpfill
|
|||||||
|
|
||||||
import org.openrndr.color.ColorRGBa
|
import org.openrndr.color.ColorRGBa
|
||||||
import org.openrndr.draw.*
|
import org.openrndr.draw.*
|
||||||
import org.openrndr.filter.filterShaderFromUrl
|
|
||||||
import org.openrndr.math.Matrix44
|
import org.openrndr.math.Matrix44
|
||||||
import org.openrndr.math.Vector2
|
import org.openrndr.math.Vector2
|
||||||
import org.openrndr.resourceUrl
|
import org.openrndr.resourceUrl
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ fun generateBox(width: Double = 1.0, height: Double = 1.0, depth: Double = 1.0,
|
|||||||
// +x -- ZY
|
// +x -- ZY
|
||||||
generatePlane(Vector3(width / 2.0 * sign, 0.0, 0.0),
|
generatePlane(Vector3(width / 2.0 * sign, 0.0, 0.0),
|
||||||
Vector3.UNIT_Z, Vector3.UNIT_Y, Vector3.UNIT_X,
|
Vector3.UNIT_Z, Vector3.UNIT_Y, Vector3.UNIT_X,
|
||||||
depth, height,
|
-depth, -height,
|
||||||
depthSegments, heightSegments, writer)
|
depthSegments, heightSegments, writer)
|
||||||
|
|
||||||
// -x -- ZY
|
// -x -- ZY
|
||||||
generatePlane(Vector3(-width / 2.0 * sign, 0.0, 0.0),
|
generatePlane(Vector3(-width / 2.0 * sign, 0.0, 0.0),
|
||||||
Vector3.UNIT_Z, Vector3.UNIT_Y, -Vector3.UNIT_X,
|
Vector3.UNIT_Z, Vector3.UNIT_Y, -Vector3.UNIT_X,
|
||||||
depth, height,
|
-depth, height,
|
||||||
depthSegments, heightSegments, writer)
|
depthSegments, heightSegments, writer)
|
||||||
|
|
||||||
// +y -- XZ
|
// +y -- XZ
|
||||||
@@ -44,13 +44,13 @@ fun generateBox(width: Double = 1.0, height: Double = 1.0, depth: Double = 1.0,
|
|||||||
// -y -- XZ
|
// -y -- XZ
|
||||||
generatePlane(Vector3(0.0, -height / 2.0 * sign, 0.0),
|
generatePlane(Vector3(0.0, -height / 2.0 * sign, 0.0),
|
||||||
Vector3.UNIT_X, Vector3.UNIT_Z, -Vector3.UNIT_Y,
|
Vector3.UNIT_X, Vector3.UNIT_Z, -Vector3.UNIT_Y,
|
||||||
width, depth,
|
width, -depth,
|
||||||
widthSegments, depthSegments, writer)
|
widthSegments, depthSegments, writer)
|
||||||
|
|
||||||
// +z -- XY
|
// +z -- XY
|
||||||
generatePlane(Vector3(0.0, 0.0, depth / 2.0 * sign),
|
generatePlane(Vector3(0.0, 0.0, depth / 2.0 * sign),
|
||||||
Vector3.UNIT_X, Vector3.UNIT_Y, Vector3.UNIT_Z,
|
Vector3.UNIT_X, Vector3.UNIT_Y, Vector3.UNIT_Z,
|
||||||
width, height,
|
-width, height,
|
||||||
widthSegments, heightSegments, writer)
|
widthSegments, heightSegments, writer)
|
||||||
|
|
||||||
// -z -- XY
|
// -z -- XY
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ fun planeMesh(center: Vector3,
|
|||||||
forward: Vector3,
|
forward: Vector3,
|
||||||
up: Vector3 = forward.cross(right).normalized,
|
up: Vector3 = forward.cross(right).normalized,
|
||||||
width: Double = 1.0, height: Double = 1.0,
|
width: Double = 1.0, height: Double = 1.0,
|
||||||
widthSegments: Int = 1, heightSegments: Int = 2): VertexBuffer {
|
widthSegments: Int = 1, heightSegments: Int = 1): VertexBuffer {
|
||||||
|
|
||||||
val vertexCount = (widthSegments * heightSegments) * 6
|
val vertexCount = (widthSegments * heightSegments) * 6
|
||||||
val vb = meshVertexBuffer(vertexCount)
|
val vb = meshVertexBuffer(vertexCount)
|
||||||
@@ -72,13 +72,13 @@ fun generatePlane(center: Vector3,
|
|||||||
val c10 = corner + forwardStep * v.toDouble() + rightStep * (u + 1).toDouble()
|
val c10 = corner + forwardStep * v.toDouble() + rightStep * (u + 1).toDouble()
|
||||||
val c11 = corner + forwardStep * (v + 1).toDouble() + rightStep * (u + 1).toDouble()
|
val c11 = corner + forwardStep * (v + 1).toDouble() + rightStep * (u + 1).toDouble()
|
||||||
|
|
||||||
writer(c00, up, uv00)
|
writer(c11, up, uv00)
|
||||||
writer(c10, up, uv10)
|
writer(c10, up, uv10)
|
||||||
writer(c11, up, uv11)
|
writer(c00, up, uv11)
|
||||||
|
|
||||||
writer(c11, up, uv11)
|
writer(c00, up, uv11)
|
||||||
writer(c01, up, uv01)
|
writer(c01, up, uv01)
|
||||||
writer(c00, up, uv00)
|
writer(c11, up, uv00)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,17 +33,17 @@ fun generateSphere(sides: Int, segments: Int, radius: Double = 1.0, invert: Bool
|
|||||||
writer(st11.cartesian, st11.cartesian.normalized * inverter, Vector2(st11.phi / phiMax, st11.theta / thetaMax))
|
writer(st11.cartesian, st11.cartesian.normalized * inverter, Vector2(st11.phi / phiMax, st11.theta / thetaMax))
|
||||||
}
|
}
|
||||||
segments - 1 -> {
|
segments - 1 -> {
|
||||||
writer(st00.cartesian, st00.cartesian.normalized * inverter, Vector2(st00.phi / phiMax, st00.theta / thetaMax))
|
|
||||||
writer(st10.cartesian, st10.cartesian.normalized * inverter, Vector2(st10.phi / phiMax, st10.theta / thetaMax))
|
|
||||||
writer(st11.cartesian, st11.cartesian.normalized * inverter, Vector2(st11.phi / phiMax, st11.theta / thetaMax))
|
writer(st11.cartesian, st11.cartesian.normalized * inverter, Vector2(st11.phi / phiMax, st11.theta / thetaMax))
|
||||||
|
writer(st10.cartesian, st10.cartesian.normalized * inverter, Vector2(st10.phi / phiMax, st10.theta / thetaMax))
|
||||||
|
writer(st00.cartesian, st00.cartesian.normalized * inverter, Vector2(st00.phi / phiMax, st00.theta / thetaMax))
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
writer(st00.cartesian, st00.cartesian.normalized * inverter, Vector2(st00.phi / phiMax, st00.theta / thetaMax))
|
writer(st00.cartesian, st00.cartesian.normalized * inverter, Vector2(st00.phi / phiMax, st00.theta / thetaMax))
|
||||||
writer(st10.cartesian, st10.cartesian.normalized * inverter, Vector2(st10.phi / phiMax, st10.theta / thetaMax))
|
writer(st01.cartesian, st01.cartesian.normalized * inverter, Vector2(st01.phi / phiMax, st01.theta / thetaMax))
|
||||||
writer(st11.cartesian, st11.cartesian.normalized * inverter, Vector2(st11.phi / phiMax, st11.theta / thetaMax))
|
writer(st11.cartesian, st11.cartesian.normalized * inverter, Vector2(st11.phi / phiMax, st11.theta / thetaMax))
|
||||||
|
|
||||||
writer(st11.cartesian, st11.cartesian.normalized * inverter, Vector2(st11.phi / phiMax, st11.theta / thetaMax))
|
writer(st11.cartesian, st11.cartesian.normalized * inverter, Vector2(st11.phi / phiMax, st11.theta / thetaMax))
|
||||||
writer(st01.cartesian, st01.cartesian.normalized * inverter, Vector2(st01.phi / phiMax, st01.theta / thetaMax))
|
writer(st10.cartesian, st10.cartesian.normalized * inverter, Vector2(st10.phi / phiMax, st10.theta / thetaMax))
|
||||||
writer(st00.cartesian, st00.cartesian.normalized * inverter, Vector2(st00.phi / phiMax, st00.theta / thetaMax))
|
writer(st00.cartesian, st00.cartesian.normalized * inverter, Vector2(st00.phi / phiMax, st00.theta / thetaMax))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user