I cannot find any method in document(pc.Vec3). there is only one method call “project” but this function is project a point to a vector.
You can use something similar with the example provided in the documentation for the Vec3 project method.
The normal in this case would be the vector pointing outwards from the surface:
// vec is your vector // normal is the vector pointing outwards from the horizontal surface var normal = new pc.Vec3(0, 1, 0); vec.project(normal); console.log("The result of the vector projection is: " + vec.toString());
Thank you so much. I will try this when I wake up. It’s 5am China time.
It’s seems not work in my case…
Can you provide us with a sample project?