Tag Info

Hot answers tagged

2

Within a 3D rendered scene, there are typically three main matrices used to transform an object from its own local space (object/model space) to a homogeneous space known as screen space. World The World matrix being the first, is unique for every object within your world, and is responsible for transforming the vertices of an object from its own local ...


2

The values you'd get from glGet with GL_VIEWPORT (that you were previously passing to glUnProject) are the same values you have previously used to define the OpenGL viewport size using glViewport. If, as noted in the referenced documentation, you've never called glViewport yourself, the width and height of the viewport are the dimensions of the (client ...


2

I think this may be your problem: Matrix.CreateTranslation(new Vector3(new Vector2((float)-BoundingBox.Width / 2, (float)-BoundingBox.Height / 2), 0.0f)) It appears you are trying to create a translation to the point of origin, which is what you should do when creating a rotation matrix, however, you are creating it based on your BoundingBox width and ...


1

Probably, the terms "model-view-projection" matrix and "world-view-project" matrix refer to the same conceptual transform. The two terms can be used interchangeably, and the difference in terminology could stem from one source being more familiar with OpenGL (which uses the term "modelview") or D3D (which splits the concept into "world" and "view" ...


1

You're adding the three X, Y, Z rotations together. You need to multiply them, instead. Compute three separate matrices using those three formulas, and multiply them together. (Note that you might have to multiply them in reverse order, Z * Y * X - it depends on what convention you want for your Euler angles.) Also, you have an incorrect negative sign in ...


1

for the different matrix constructors: no it's easier to do a chained invocation matrix = Matrix4d.identity().rotateYaw(yaw).rotatePitch(pitch).translate(attachPoint);, and each of these rotate operations can be optimized (and the inverse calculated along side it) the bottom (0 0 0 1) row can be optimized out easily by not even storing them (assume all ...



Only top voted, non community-wiki answers of a minimum length are eligible