mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-18 11:54:59 -04:00
rendering: fix one more problem regarding rotation about the wrong axis
This commit is contained in:
parent
2ce1f233af
commit
d8eda49ac4
@ -60,7 +60,7 @@ open class BlockModel(val parent: BlockModel? = null, json: JsonObject) {
|
||||
val modelMatrix = Mat4().translate(Vec3(position.x, position.y, position.z))
|
||||
.rotate(rotation.z, Vec3(0, 0, -1))
|
||||
.rotate(rotation.y, Vec3(0, -1, 0))
|
||||
.rotate(rotation.x, Vec3(-1, 0, 0))
|
||||
.rotate(rotation.x, Vec3(1, 0, 0))
|
||||
// ToDo: this should be made easier/more efficient
|
||||
|
||||
for (direction in Directions.DIRECTIONS) {
|
||||
|
@ -160,12 +160,12 @@ open class BlockModelElement(data: JsonObject) {
|
||||
}
|
||||
|
||||
when (realDirection) {
|
||||
Directions.DOWN -> createQuad(drawPositions, face.texturLeftDown, face.texturLeftUp, face.texturRightUp, face.texturRightDown)
|
||||
Directions.UP -> createQuad(drawPositions, face.texturLeftDown, face.texturLeftUp, face.texturRightUp, face.texturRightDown)
|
||||
Directions.NORTH -> createQuad(drawPositions, face.texturRightDown, face.texturRightUp, face.texturLeftUp, face.texturLeftDown)
|
||||
Directions.SOUTH -> createQuad(drawPositions, face.texturLeftDown, face.texturLeftUp, face.texturRightUp, face.texturRightDown)
|
||||
Directions.WEST -> createQuad(drawPositions, face.texturRightUp, face.texturRightDown, face.texturLeftDown, face.texturLeftUp)
|
||||
Directions.EAST -> createQuad(drawPositions, face.texturLeftUp, face.texturLeftDown, face.texturRightDown, face.texturRightUp)
|
||||
Directions.DOWN -> createQuad(drawPositions, face.textureLeftDown, face.textureLeftUp, face.textureRightUp, face.textureRightDown)
|
||||
Directions.UP -> createQuad(drawPositions, face.textureLeftDown, face.textureLeftUp, face.textureRightUp, face.textureRightDown)
|
||||
Directions.NORTH -> createQuad(drawPositions, face.textureRightDown, face.textureRightUp, face.textureLeftUp, face.textureLeftDown)
|
||||
Directions.SOUTH -> createQuad(drawPositions, face.textureLeftDown, face.textureLeftUp, face.textureRightUp, face.textureRightDown)
|
||||
Directions.WEST -> createQuad(drawPositions, face.textureRightUp, face.textureRightDown, face.textureLeftDown, face.textureLeftUp)
|
||||
Directions.EAST -> createQuad(drawPositions, face.textureLeftUp, face.textureLeftDown, face.textureRightDown, face.textureRightUp)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,10 +25,10 @@ class BlockModelFace(data: JsonObject) {
|
||||
}
|
||||
}
|
||||
|
||||
val texturLeftDown = Vec2(uvToFloat(textureStart.x), uvToFloat(textureStart.y))
|
||||
val texturLeftUp = Vec2(uvToFloat(textureStart.x), uvToFloat(textureEnd.y))
|
||||
val texturRightUp = Vec2(uvToFloat(textureEnd.x), uvToFloat(textureEnd.y))
|
||||
val texturRightDown = Vec2(uvToFloat(textureEnd.x), uvToFloat(textureStart.y))
|
||||
val textureLeftDown = Vec2(uvToFloat(textureStart.x), uvToFloat(textureStart.y))
|
||||
val textureLeftUp = Vec2(uvToFloat(textureStart.x), uvToFloat(textureEnd.y))
|
||||
val textureRightUp = Vec2(uvToFloat(textureEnd.x), uvToFloat(textureEnd.y))
|
||||
val textureRightDown = Vec2(uvToFloat(textureEnd.x), uvToFloat(textureStart.y))
|
||||
|
||||
|
||||
companion object {
|
||||
|
Loading…
x
Reference in New Issue
Block a user