thehankinator Posted July 21, 2018 Share Posted July 21, 2018 I am not able to divide a Vec2 or Vec4 but Vec3 works fine. Seems like this should work, am I wrong? local Case1 = Vec2(164, 0) / 255 --Doesn't work local Case2 = Vec3(164, 0, 0) / 255 --Works local Case3 = Vec4(164, 0, 0, 255) / 255 --Doesn't work Error message for Case1 and 3 is: Attempt to perform operation on an invalid operand Quote Link to comment Share on other sites More sharing options...
macklebee Posted July 21, 2018 Share Posted July 21, 2018 Appears they are missing looking at the class members available for Vec3 versus Vec2 & Vec4: Vec3 Vec4 Vec2 .add .add missing members .div .eq .eq .mul .mul .sub Don't know for sure if related but it appears to be. The '.div' member is missing for Vec4, but since the '.mul' member exists you can make Case3 work by multiplying the Vec4() with (1/255). Would be nice if the other two vector classes were given the same abilities. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted July 22, 2018 Share Posted July 22, 2018 Yeah, the Vec2 and Vec4 classes don't get used as often so there are a few missing operands. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
thehankinator Posted July 23, 2018 Author Share Posted July 23, 2018 19 hours ago, Josh said: Yeah, the Vec2 and Vec4 classes don't get used as often so there are a few missing operands. It'd be handy if Vec4 had a division operator for converting colors defined in 0-255 to 0-1 1 Quote Link to comment Share on other sites More sharing options...
macklebee Posted July 23, 2018 Share Posted July 23, 2018 16 hours ago, thehankinator said: It'd be handy if Vec4 had a division operator for converting colors defined in 0-255 to 0-1 Just curious, but what do you have that is defining colors in 0-255? The editor does when you use the color picker but those values are converted to the 0-1 scale. Everything in LE now except for the color picker itself (which I suspect is due to the OS), specifically uses 0-1, so what are you doing/using that would require that specifically where you couldn't just make a simple function to handle it? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
thehankinator Posted July 23, 2018 Author Share Posted July 23, 2018 10 minutes ago, macklebee said: Just curious, but what do you have that is defining colors in 0-255? The editor does when you use the color picker but those values are converted to the 0-1 scale. Everything in LE now except for the color picker itself (which I suspect is due to the OS), specifically uses 0-1, so what are you doing/using that would require that specifically where you couldn't just make a simple function to handle it? I am creating emitters in code. It's convenient for me to define them in the editor then convert them to code. I don't have to do it this way but a division operator for a Vec4 isn't an uncommon thing in a vector library. Nothing I am doing requires this operator, I've already got a workaround. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.