Implemented MeshTangents()
- Added Vector3OrthoNormalize() to raymath.h - not sure if it is correct - Implemented MeshBinormals() - Mesh struct has not a place for them... - Updated model_material_pbr example - tested but not working on my GPU (old Intel HD), actually, it never worked on it...
This commit is contained in:
parent
c51203ae7e
commit
23e335d933
3 changed files with 91 additions and 4 deletions
|
|
@ -372,6 +372,17 @@ RMDEF Vector3 Vector3Normalize(Vector3 v)
|
|||
return result;
|
||||
}
|
||||
|
||||
// Orthonormalize provided vectors
|
||||
// Makes vectors normalized and orthogonal to each other
|
||||
// Gram-Schmidt function implementation
|
||||
RMDEF void Vector3OrthoNormalize(Vector3 *v1, Vector3 *v2)
|
||||
{
|
||||
*v1 = Vector3Normalize(*v1);
|
||||
Vector3 vn = Vector3CrossProduct(*v1, *v2);
|
||||
vn = Vector3Normalize(vn);
|
||||
*v2 = Vector3CrossProduct(vn, *v1);
|
||||
}
|
||||
|
||||
// Transforms a Vector3 by a given Matrix
|
||||
RMDEF Vector3 Vector3Transform(Vector3 v, Matrix mat)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue