void Material::ScaleTextureMatrix(const IvVector3& scale, int idx) { //mUseTextureMatrix = true; IvMatrix44 m; m.Scaling(scale); mTextureMatrices[idx] *= m; }
//------------------------------------------------------------------------------- // @ Player::Render() //------------------------------------------------------------------------------- // Render stuff //------------------------------------------------------------------------------- void Player::Render() { mLightPosUniform->SetValue(mLightPos[0], 0); mLightPosUniform->SetValue(mLightPos[1], 1); int i,j; for (j = -1; j <= 1; j++) { for (i = -1; i <= 1; i++) { // build 4x4 matrix IvMatrix44 transform; transform.Scaling(IvVector3(mRadius, mRadius, mRadius)); transform(0, 3) = 5.0f * i; transform(2, 3) = 5.0f * j; mViewPosUniform->SetValue(IvVector3(0.0f, -10.0f, 0.0f), 0); IvSetWorldMatrix(transform); mShader->GetUniform("modelMatrix")->SetValue(transform, 0); // draw geometry IvDrawUnitSphere(); } } } // End of Player::Render()
//------------------------------------------------------------------------------- // @ Player::Render() //------------------------------------------------------------------------------- // Render stuff //------------------------------------------------------------------------------- void Player::Render() { // build 4x4 matrix IvMatrix44 transform; transform.Scaling(IvVector3(mRadius, mRadius, mRadius)); int i,j; for (j = -1; j <= 1; j++) { for (i = -1; i <= 1; i++) { transform(0, 3) = 5.0f * i; transform(2, 3) = 5.0f * j; mShader->GetUniform("spotLightPosition")->SetValue( mLightPos, 0); mShader->GetUniform("spotLightDir")->SetValue( mLightDir, 0); ::IvSetWorldMatrix(transform); mShader->GetUniform("modelMatrix")->SetValue(transform, 0); // draw geometry IvDrawUnitSphere(); } } } // End of Player::Render()