Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object3d.worldToLocal #3357

Closed
redblackbit opened this issue Apr 22, 2013 · 5 comments
Closed

Object3d.worldToLocal #3357

redblackbit opened this issue Apr 22, 2013 · 5 comments

Comments

@redblackbit
Copy link

The method treats the input vector as a point expressed in homogeneous coordinates. This behavior should be commented.

@WestLangley
Copy link
Collaborator

No. Object3d.worldToLocal( vector ) takes a Vector3 argument, and treats the input vector as a 3D point.

@redblackbit
Copy link
Author

Which is exactly what I meant. A 4D vector with w = 1 corresponds to a 3D point with the same coordinates but what if you want to transform a vector instead (i.e. w = 0)?
In the API sometimes a Vector3 means a vector and some other times it means a point and the meaning depends on the context. In the above case it's not obvious that the user wants to transform a point instead of a vector.

@WestLangley
Copy link
Collaborator

Sorry, I do not understand what you are saying.

  1. Can you please explain it another way -- with a specific example?
  2. Can you please point to the specific API document(s) you are referring to?

@redblackbit
Copy link
Author

my_obj.worldToLocal(new THREE.Vector3(1, 1, 1));

Without documentation/experimentation it's not clear if the input parameter is treated as point or as vector.

@dubejf dubejf mentioned this issue Jul 1, 2015
@dubejf
Copy link
Contributor

dubejf commented Jul 1, 2015

In this context, "vector" means "point". worldToLocal transforms the Cartesian coordinates of a point from world space to local space.

@dubejf dubejf closed this as completed Jul 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants