doc Posted August 17, 2009 Share Posted August 17, 2009 I'm probably being stupid about this so please bear with me: I have the following code: normal=t_vec1.cross(t_vec2) n_len=normal.length() n_normal=normal/n_len which is generating the following error: TypeError: unsupported operand type(s) for /: 'Vector3' and 'float' Which seems odd because dividing a vector by a float should be a legit mathematical operation... right? as an alternative I tried: normal=t_vec1.cross(t_vec2) n_len=normal.length() n_normal=normal/hou.Vector3(n_len,n_len,n_len) but that doesn't seem to work either: TypeError: unsupported operand type(s) for /: 'Vector3' and 'Vector3' any idea how to get around this? thanks in advance L Quote Link to comment Share on other sites More sharing options...
doc Posted August 17, 2009 Author Share Posted August 17, 2009 just figured out a workaround: normal=t_vec1.cross(t_vec2) n_len=normal.length() n_normal=normal*(1/n_len) Quote Link to comment Share on other sites More sharing options...
edward Posted August 17, 2009 Share Posted August 17, 2009 Can't you just do n_normal = normal.normalized() ? 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.