Easiest way to multiply vector values together?

前端 未结 1 1789
傲寒
傲寒 2021-01-18 07:56

I\'ve got a silly question. I took a vector math class about 10 years ago and could\'ve sworn I remembered an operation that allowed me to multiply the values of a vector to

相关标签:
1条回答
  • 2021-01-18 08:56

    When we electrical engineers want to sound smart, we call it the Hadamard product, but otherwise it’s just the “element-wise product”.

    What library are you using? GLSL? Eigen? GSL? We can look for how to do element-wise multiplication in it. (It can often be accelerated using SIMD, so an optimized implementation provided by a library will be faster than your hand-rolled function.)

    Edit: Unity calls this Vector3.Scale: “Multiplies two vectors component-wise.”

    0 讨论(0)
提交回复
热议问题