1
Poszukuję / Odp: Poszukuje grafika
« dnia: Luty 14, 2015, 12:27:29 »
Jestem grafikiem komputerowym, odezwij się na eliasz.proc@gmail.com może się dogadamy.
Ta sekcja pozwala Ci zobaczyć wszystkie wiadomości wysłane przez tego użytkownika. Zwróć uwagę, że możesz widzieć tylko wiadomości wysłane w działach do których masz aktualnie dostęp.
vec3 bump = normalize( texture2D(normalMap, texCoord).xyz * 2.0 - 1.0);
float diffuse = max( dot(lVec, bump), 0.0 );
for ( int i = 0; i < mesh.VertexList.size(); ++i )
{
Vector3f finalPos = new Vector3f();
Vertex vert = mesh.VertexList.get(i);
vert.m_Pos = new Vector3f();
// Sum the position of the weights
for ( int j = 0; j < vert.m_WeightCount; ++j )
{
Weight weight = mesh.WeightList.get(vert.m_StartWeight + j);
Joint joint = JointList.get(weight.m_JointID);
xQuat rotPos = new xQuat();
rotPos.multiply(joint.m_Orient, weight.m_Pos);
Vector3f rotPos2 = new Vector3f();
rotPos2.x=rotPos.x;
rotPos2.y=rotPos.y;
rotPos2.z=rotPos.z;
Vector3f a = new Vector3f();
a.add(joint.m_Pos);
a.add( rotPos2);
a.x=(a.x*weight.m_Bias);
a.y=(a.y*weight.m_Bias);
a.z=(a.z*weight.m_Bias);
vert.m_Pos.add(a);
}
mesh.m_PositionBuffer.add(vert.m_Pos);
mesh.Tex2DBuffer.add(vert.m_Tex0);
}
public void multiply(xQuat left, Vector3f right) // this = a * b
{
float a,b,c,d;
a = - left.x*right.x - left.y*right.y - left.z *right.z;
b = left.w*right.x + left.y*right.z - right.y*left.z;
c = left.w*right.y + left.z*right.x - right.z*left.x;
d = left.w*right.z + left.x*right.y - right.x*left.y;
w = a;
x = b;
y = c;
z = d;
}