示例#1
0
文件: gl.c 项目: machinamentum/gl2gx
void  glScalef (GLfloat x, GLfloat y, GLfloat z){
	Mtx temp;

	guMtxIdentity(temp);
	guMtxScale(temp, x, y, z);
	guMtxConcat(model,temp,model);
}
void Util3D::TransScale(f32 xpos, f32 ypos, f32 zpos , f32 scale)
{
	Mtx FinalMatrix,TransMatrix;
	guMtxScale(TransMatrix,scale,scale,scale);
	guMtxTransApply(TransMatrix,TransMatrix,xpos, ypos, zpos );	// Position
	guMtxConcat(Singleton<WiiManager>::GetInstanceByRef().GetCamera()->GetcameraMatrix(),TransMatrix,FinalMatrix);
	GX_LoadPosMtxImm (FinalMatrix, GX_PNMTX0); 
}
示例#3
0
static void
set_sep_scale (Mtx sep_scale, sync_info *sync)
{
  if (sync->bar >= 73 && sync->bar <= 75)
    {
      float beat = 4.0 * (sync->bar_pos - 0.25);
      float bar_pos_adj = sync->bar_pos + (float) sync->bar - 73.0;
      float size, bar_impulse;
      beat = beat - floorf (beat);
      if (bar_pos_adj >= 0)
        bar_impulse = impulse (4, bar_pos_adj);
      else
        bar_impulse = 0.0;
      size = 10.0 + 10.0 * impulse (4, beat) * bar_impulse;
      guMtxScale (sep_scale, size, size, size);
    }
  else
    guMtxScale (sep_scale, 10.0, 10.0, 10.0);
}
示例#4
0
void
skybox_set_matrices (scene_info *scene, Mtx camera, skybox_info *skybox,
		     Mtx projection, u32 projection_type)
{
  Mtx offset_mtx;
  Mtx sep_scale;
  
  guMtxTrans (offset_mtx, scene->pos.x / skybox->radius,
	      scene->pos.y / skybox->radius, scene->pos.z / skybox->radius);
  guMtxScale (sep_scale, skybox->radius, skybox->radius, skybox->radius);

  object_set_matrices (scene, &skybox->skybox_loc, camera, offset_mtx,
		       sep_scale, projection, projection_type);
}