Tag Info

Hot answers tagged

4

Local versus world is just a matter of the order in which you compose transforms. For instance, when using row-vector math, multiplying the current local-to-world transform by a new transform on the left will perform the new transform in local space, since it will be equivalent to doing the new transform followed by the old local-to-world transform. ...


2

First thing I see is that you shouldn't read the quaternion in reverse order. Also you shouldn't use glm::mix, use glm::slerp instead. And here is how I construct the bone transform: mat = glm::mat4_cast( currentrotation ); mat[0][0] *= currentscale.x; mat[1][0] *= currentscale.x; mat[2][0] *= currentscale.x; mat[0][1] *= currentscale.y; mat[1][1] *= ...


2

Well if I understand well as @user8363 explained in the comments, your problem is that you are making one direction for all the particles, which makes the particles move in that direction. If you want the particles to accelerate toward the point you need to make a direction vector for each particle. For instance: foreach particle: acc = particle - ...


2

historically billboards matrix just copy the camera view matrix, and replace the last row with their own world position. the scale can be world-fixed if you want trees or hard stuff. But it can also be screen-fixed for halo effects, in which case you need to scale using the euclidian distance. this can be done in the vertex shader rather than on CPU as an ...


1

The bug quite likely comes from angleAxis requiring a normalized vector (see quaternion.inl in the source code). You need to call normalize() on the cross product result. (you might be interested in my article about creating a quaternion from two vectors without using trigonometry functions)


1

Disclaimer: I generally don't work in 3D, so possible inaccuracies, vague details, and untested thoughts may follow. When you say you want the object to "follow the mouse", what do you really mean? In another sense, you can interpret it like this: you want a certain point on the object to be "below" the mouse at all times. We'll call this point the "anchor ...


1

I've done it by using a mix of Lighthouse3D tutorial, which I got by following the tip of @concept3d. My previous Frustum Culling routine was execute in about 12~16ms using Clip Space approach, but extracting planes from camera, I can execute it in 1~2ms....So, the peformance boost is awesome. Here is my final code. Whenever my rotation/position changes, I ...


1

Your top code chunk is: t2 * (t1 * direction * inverse(t1)) * inverse(t2) Your bottom chunk is: t3 * direction * inverse(t3) Given that t3 = t2 * t1 It's (t2 * t1) * direction * inverse(t2 * t1) As far as my knowledge of Quaternion multiplication goes, I don't think t2 * (t1 * direction * inverse(t1)) * inverse(t2) and (t2 * t1) * direction * ...



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