# Tag Info

## Hot answers tagged matlab

4

I've done some small changes to how I usually construct my view matrix, here is what I've modified: // put it after N = ... U = cross(N, Vspec); U = U / sqrt(dot(U,U)); % normalize V = cross(U, N); Then I also set N vector as -N to R matrix, like this: R= [U(1),U(2),U(3),0; % U is direction of camera space X axis V(1),V(2),V(3),0; % V is direction of ...

3

Just realized that this is an equation involving homogeneous vectors; thus the 3-vectors should not equal, they have the same direction but may differ in magnitude by a nonzero scale factor.

2

The values will only form a cube after performing the perspective divide, which I don't see happening in your code. That is, you take a vector $[x, y, z, 1]$ and transform it by the projection matrix, resulting in a new vector $[x', y', z', w']$. Then divide out the fourth component to get a 3D vector, $[x'/w', y'/w', z'/w']$. This last is the one that ...

2

Your transform looks correct. To transform from world to eye coordinates, I I always use a "lookat" transform, defined by 3 vectors: $\bf{e}$, $\bf{a}$ and $\bf{u}$; in english, the eye position, the point it's looking at, and an up vector, which must not be in the same direction as $\bf{a} - \bf{e}$ (more specifically, not a multiple of it). The space is ...

1

A function $f$ on your triangulated surface is an assignment of real numbers on the vertices of the triangulation and therefore $f \in \mathbb{R}^{|\mathcal{V}|}$. According to the continuous theory, the gradient should be a linear (differential) operator that takes a function and spits out a vector field. Hence, in the discrete theory, the gradient should ...

1

First simple thresholding is usually not a good idea. However, if you want to do that, I suggest to also consider other color spaces. In your case, HSV might be a better choice; You can convert your image into HSV-image then you can define a range on Hue channel to select yellow. Also, take a look at this article; it is about implementing Adaptive ...

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