Closed Vild closed 9 years ago
Internally it looks like that:
Matrix rotate(real alpha, Vector!(mt, 3) axis) {
this = rotation(alpha, axis) * this;
return this;
}
Matrix rotatex(real alpha) {
this = xrotation(alpha) * this;
return this;
}
So e.g. you would use it like that:
@property override
mat4 camera() {
vec3 pos = -(position + offset);
return mat4.identity.translate(pos.x, pos.y, pos.z)
.rotatey(-rotation.y)
.rotatex(rotation.x);
}
(from https://github.com/Dav1dde/BraLa/blob/master/brala/gfx/camera.d#L122-L123)
Here I got a example of the problem of my problem. Have I done anything wrong? I also added C++ equal code. (Which is what i'm translating from) https://github.com/WildN00b/gl3n-thing/blob/master/source/app.d#L124
Hey, I'm just wondering if i'm doing something wrong if i need to write all my transformation calls backwards for example:
When I read the documentation for gl3n you write it in this order.
And other example is:
This does not work
This does work
Am I doing something wrong or is this a bug?
I am using ldc (which is the default for dub)