예제 #1
0
void ScaleAndBiasDlg::CopyScaleAndBias() {
  FLOATMATRIX4 bias;
  FLOATMATRIX4 scale;

  bias.Translation(biasVec);
  scale.Scaling(scaleVec);

  SetExpertTransform(scale*bias);
}
예제 #2
0
void Mesh::ScaleAndBias(const FLOATVECTOR3& scale,
                        const FLOATVECTOR3& translation) {

  for (VertVec::iterator i = m_Data.m_vertices.begin();i<m_Data.m_vertices.end();i++)
	  *i = (*i*scale) + translation;

  m_Bounds[0] = (m_Bounds[0] * scale) + translation;
  m_Bounds[1] = (m_Bounds[1] * scale) + translation;

  FLOATMATRIX4 s;  s.Scaling(scale);
  FLOATMATRIX4 b;  b.Translation(translation);
  m_TransformFromOriginal = m_TransformFromOriginal * s * b;

  GeometryHasChanged(false, true);
}
예제 #3
0
FLOATMATRIX4 GLRaycaster::ComputeEyeToTextureMatrix(const RenderRegion &renderRegion,
                                                    FLOATVECTOR3 p1, FLOATVECTOR3 t1,
                                                    FLOATVECTOR3 p2, FLOATVECTOR3 t2,
                                                    EStereoID eStereoID) const {
  FLOATMATRIX4 m;

  FLOATMATRIX4 mInvModelView = renderRegion.modelView[size_t(eStereoID)].inverse();

  FLOATVECTOR3 vTrans1 = -p1;
  FLOATVECTOR3 vScale  = (t2-t1) / (p2-p1);
  FLOATVECTOR3 vTrans2 =  t1;

  FLOATMATRIX4 mTrans1;
  FLOATMATRIX4 mScale;
  FLOATMATRIX4 mTrans2;

  mTrans1.Translation(vTrans1.x,vTrans1.y,vTrans1.z);
  mScale.Scaling(vScale.x,vScale.y,vScale.z);
  mTrans2.Translation(vTrans2.x,vTrans2.y,vTrans2.z);

  m = mInvModelView * mTrans1 * mScale * mTrans2;

  return m;
}