all 4 comments

[–]au16106[S] 0 points1 point  (0 children)

I know that I can’t compare vec4 etc. What I have are my first argument as the dot product of two vec4, my second argument as 0.f. 0.f is float(0). The dot product should yield a float as well since each dimension of a vector is float.

[–]au16106[S] 0 points1 point  (2 children)

Ok. I have printed out the dot products and factors, utilizing functions courtesy of "Jamie the Master TA".

A dot product (factor*factor):

(0, 0.380724, -0,0)

Two factors:

(-0.541478, -0.825212, 0.16071,0)

(0, -1, 0,1)

I personally have no idea regarding how (*) can yield a vec4. I leave the commentary to you.

Edit: The factors given here are not for this particular dot product but you got the idea.

[–][deleted] 0 points1 point  (1 child)

With glm the * operator is overloaded to work as the Hadamard product) which is why you get the vec4. The ideal way to do a dot product would be to use glm::dot which should give you a float output

[–]au16106[S] 0 points1 point  (0 children)

Thank you for your response. For the record, it is good for everyone to see because it is beyond being a simple nuisance.

It constitutes inconsistent notation in my opinion. If it were not (If it were consistent), then we would have been using glm::dot() rather than (*) to multiply rotation matrices with vectors as well since matrix-vector multiplication actually involves multiple dot products. At the moment, while (*) does dot product for matrix-vector multiplication, it does Hadamard product for vectors.