New answers tagged

0

It's a bit vague what you want to do and what you have. But this should help: Vector3 pos = new Vector3(); Matrix4 nodeTransform = new Matrix4(); nodeTransform.setToTranslation(2, 4, 0).rotate(Vector3.Z, 180f); nodeTransform.getTranslation(pos); Gdx.app.log("Node pos", pos.toString()); Matrix4 modelTransform = new Matrix4(); ...


0

You want to create a flat plane in 3D for this, set texture sampling to point sampling and use Matrix.CreateLookAt for the view matrix. I suggest you read up on what the world, view and projection matrices are and what they do.


0

A classic solution is to use an arcball. Here's an example implementation using the SimpleMath wrapper for DirectXMath in the DirectX Tool Kit: class ArcBall { public: ArcBall() : m_width(800.f), m_height(400.f), m_radius(1.f), m_drag(false) { Reset(); } void Reset() { m_qdown = m_qnow = ...


2

A very short cutoff tk fhis problem, if you don't want to use trigonometry, is to first translate the view matrix with the distance between the camera and the player on the +z axis, then rozate the matrix, and after that, move it to the correct place, by translating it to the player's position. However, this is the worst and laziest solution I could think ...


0

The thing you currently have is a transformation matrix Transfomation Matrices are way, to easily represent a the position, rotation and scale of an object in 3d or 2d scene, a 2d scene only needs a 3*3 matrix, a 3d one usually uses a 4*4, but 2d transformation can be represented in a 4*4 matrix too, but it just wastes space. The matrix is oriented like ...


2

In this case, the matrix is generated from the call to Matrix.CreateRotationZ, which is a function (a static method of the Matrix class). It creates a 4x4 tranformation matrix which describe a rotation about the Z axis. The formula for constructing that matrix can be seen here, as Rz. Extending that the 4x4 form used for the Matrix class, it would look like ...


0

Both options are basically the same. In the end you do have a bunch of vertices that you multiply by mModel * mView * mProjection. If you move the camera within the world, that transformations go into mView. If you move the world around - into mModel. mModel is actually constructed of many matrices guiding how objects and sub-objects are positioned within ...



Top 50 recent answers are included