Tag Info

Hot answers tagged

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

You should probably use glm::angleAxis() (documentation here): glm::quat &rot = glm::angleAxis(glm::radians(90.f), glm::vec3(0.f, 1.f, 0.f));


1

the glm::quat(float, float, float, float); constructor doesn't do what you think it does. It sets the values directly. The values of the quaternion (w, x, y, z) are in order: the cosine of half the angle, the sine of half the angle times the x coordinate of the normalized rotation axis, and the same for the y ans z components. So instead you want to use ...


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

Okay. Seems like you just want a single light-camera. But there are many different approaches. Like using multiple frustum splits (which means multiple light-cameras), which is called "Cascaded Shadow Mapping". Even the way you construct the frustum of your light-camera to encompass the main camera's frustum can be done in various ways. First some useful ...


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

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