Jump to content

python dividing a vector by a float


doc

Recommended Posts

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...