Jump to content

Recommended Posts

Hi ,

Im working on the runtime version for ProBuilder and im stack on the gizmo orientation local or planar for the face or vertex . any build in function to get it right ? 

I know that we have a function to get the normal for the face  :

Vector3 targetAxis = pb_Math.Normal(pbUtil.ValuesWithIndices(currentSelection.pb.VerticesInWorldSpace(), currentSelection.face.distinctIndices))

and for the axis creation i give this values to each axe:

xDirection = Vector3.Cross(Vector3.up.normalized, targetAxis.normalized);
yDirection = Vector3.up;
zDirection = targetAxis;

but the X and Z axes are not moving the right way when i rotate the object on the Y axe .

 

Any idea or help plz ? 

Share this post


Link to post
Share on other sites

Use :

public static void NormalTangentBitangent(pb_Object pb, pb_Face face, out Vector3 normal, out Vector3 tangent, out Vector3 bitangent)

Where normal is your Y, tangent X, and bitangent is Z.

Share this post


Link to post
Share on other sites
2 hours ago, karl said:

Use :


public static void NormalTangentBitangent(pb_Object pb, pb_Face face, out Vector3 normal, out Vector3 tangent, out Vector3 bitangent)

Where normal is your Y, tangent X, and bitangent is Z.

Where i can find this methode with those attribut because i found it in the QuickEdit with different attributs

public static void NormalTangentBitangent(Vector3[] vertices, Vector2[] uv, qe_Triangle tri, out Vector3 normal, out Vector3 tangent, out Vector3 bitangent)

public static void NormalTangentBitangent(Vector3[] vertices, Vector2[] uv, qe_Triangle tri, out Vector3 normal, out Vector3 tangent, out Vector3 bitangent)

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×