mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-11-22 15:02:20 +00:00
Added some getter functions to GRRMOD
This commit is contained in:
parent
0eaf5e1c50
commit
957e2fe2c0
2 changed files with 41 additions and 45 deletions
|
@ -502,8 +502,6 @@ void GRRLIB_DrawCube(f32 size, bool filled, u32 col) {
|
||||||
* @param r Radius of the cylinder.
|
* @param r Radius of the cylinder.
|
||||||
* @param h High of the cylinder.
|
* @param h High of the cylinder.
|
||||||
* @param d Dencity of slice.
|
* @param d Dencity of slice.
|
||||||
* @param cap1 Draw the upper Cap.
|
|
||||||
* @param cap2 Draw the under Cap.
|
|
||||||
* @param filled Wired or not.
|
* @param filled Wired or not.
|
||||||
* @param col Color of the cylinder.
|
* @param col Color of the cylinder.
|
||||||
*/
|
*/
|
||||||
|
@ -555,7 +553,6 @@ void GRRLIB_DrawCylinder(f32 r, f32 h, int d, bool filled, u32 col) {
|
||||||
* @param r Radius of the cone.
|
* @param r Radius of the cone.
|
||||||
* @param h High of the cone.
|
* @param h High of the cone.
|
||||||
* @param d Dencity of slice.
|
* @param d Dencity of slice.
|
||||||
* @param cap Draw the under cap or not.
|
|
||||||
* @param filled Wired or not.
|
* @param filled Wired or not.
|
||||||
* @param col Color of the cone.
|
* @param col Color of the cone.
|
||||||
*/
|
*/
|
||||||
|
@ -645,7 +642,7 @@ void GRRLIB_SetLightSpec(u8 num, guVector dir, f32 shy, u32 lightcolor, u32 spec
|
||||||
guVecMultiplySR(mv, &ldir,&ldir);
|
guVecMultiplySR(mv, &ldir,&ldir);
|
||||||
GX_InitSpecularDirv(&MyLight, &ldir);
|
GX_InitSpecularDirv(&MyLight, &ldir);
|
||||||
|
|
||||||
GX_InitLightShininess(&MyLight, shy); // entre 4 et 255 !!!
|
GX_InitLightShininess(&MyLight, shy); // between 4 and 255 !!!
|
||||||
GX_InitLightColor(&MyLight, (GXColor) { R(lightcolor), G(lightcolor), B(lightcolor), 0xFF });
|
GX_InitLightColor(&MyLight, (GXColor) { R(lightcolor), G(lightcolor), B(lightcolor), 0xFF });
|
||||||
GX_LoadLightObj(&MyLight, (1<<num));
|
GX_LoadLightObj(&MyLight, (1<<num));
|
||||||
|
|
||||||
|
@ -664,7 +661,7 @@ void GRRLIB_SetLightSpec(u8 num, guVector dir, f32 shy, u32 lightcolor, u32 spec
|
||||||
GX_SetTevColorOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_ENABLE, GX_TEVPREV );
|
GX_SetTevColorOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_ENABLE, GX_TEVPREV );
|
||||||
GX_SetTevColorIn(GX_TEVSTAGE1, GX_CC_ZERO, GX_CC_RASC, GX_CC_ONE, GX_CC_CPREV );
|
GX_SetTevColorIn(GX_TEVSTAGE1, GX_CC_ZERO, GX_CC_RASC, GX_CC_ONE, GX_CC_CPREV );
|
||||||
|
|
||||||
/////////////////////// Define MAterial and Ambiant color and draw object /////////////////////////////////////
|
/////////////////////// Define Material and Ambiant color and draw object /////////////////////////////////////
|
||||||
GX_SetChanAmbColor(GX_COLOR1, (GXColor){0x00,0x00,0x00,0xFF}); // specualr ambient forced to black
|
GX_SetChanAmbColor(GX_COLOR1, (GXColor){0x00,0x00,0x00,0xFF}); // specualr ambient forced to black
|
||||||
GX_SetChanMatColor(GX_COLOR1, (GXColor) { R(speccolor), G(speccolor), B(speccolor), 0xFF }); // couleur du reflet specular
|
GX_SetChanMatColor(GX_COLOR1, (GXColor) { R(speccolor), G(speccolor), B(speccolor), 0xFF }); // couleur du reflet specular
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,9 +14,8 @@ extern Mtx _GRR_view;
|
||||||
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
f32 rot=0.0f;
|
f32 rot = 0.0f;
|
||||||
|
float shy = 10.0f;
|
||||||
float shy=10.0f;
|
|
||||||
|
|
||||||
GRRLIB_Init();
|
GRRLIB_Init();
|
||||||
WPAD_Init();
|
WPAD_Init();
|
||||||
|
@ -29,7 +28,7 @@ float shy=10.0f;
|
||||||
GRRLIB_SetBackgroundColour(0x40, 0x40, 0x40, 0xFF);
|
GRRLIB_SetBackgroundColour(0x40, 0x40, 0x40, 0xFF);
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
GRRLIB_Camera3dSettings(0.0f,0.0f,10.0f, 0,1,0, 0,0,0);
|
GRRLIB_Camera3dSettings(0.0f,0.0f,10.0f, 0,1,0, 0,0,0);
|
||||||
|
|
||||||
WPAD_ScanPads();
|
WPAD_ScanPads();
|
||||||
|
|
||||||
|
@ -39,57 +38,57 @@ float shy=10.0f;
|
||||||
|
|
||||||
GRRLIB_3dMode(0.1,1000,45,0,1);
|
GRRLIB_3dMode(0.1,1000,45,0,1);
|
||||||
|
|
||||||
// dir param of GRRLIB_SetLightSpec function have to be a crazy 0,0,0 value
|
// dir param of GRRLIB_SetLightSpec function have to be a crazy 0,0,0 value
|
||||||
// there is a bug in libogc about this
|
// there is a bug in libogc about this
|
||||||
// http://forums.devkitpro.org/viewtopic.php?f=7&t=1933
|
// http://forums.devkitpro.org/viewtopic.php?f=7&t=1933
|
||||||
// we are waiting for a fix from libogc devs
|
// we are waiting for a fix from libogc devs
|
||||||
GRRLIB_SetLightAmbient(0x404040FF);
|
GRRLIB_SetLightAmbient(0x404040FF);
|
||||||
GRRLIB_SetLightSpec(0, (guVector){0.0f,0.0f,0.0f}, shy, 0xFFFFFFFF, 0xFFFFFFFF);
|
GRRLIB_SetLightSpec(0, (guVector){0.0f,0.0f,0.0f}, shy, 0xFFFFFFFF, 0xFFFFFFFF);
|
||||||
|
|
||||||
GRRLIB_ObjectViewBegin();
|
GRRLIB_ObjectViewBegin();
|
||||||
GRRLIB_ObjectViewTrans(0.0f,1.3f,0.0f);
|
GRRLIB_ObjectViewTrans(0.0f,1.3f,0.0f);
|
||||||
GRRLIB_ObjectViewRotate(rot,rot*2,rot*3);
|
GRRLIB_ObjectViewRotate(rot,rot*2,rot*3);
|
||||||
GRRLIB_ObjectViewEnd();
|
GRRLIB_ObjectViewEnd();
|
||||||
GRRLIB_DrawCone(0.6f, 2.6f, 60,true, 0x502010FF);
|
GRRLIB_DrawCone(0.6f, 2.6f, 60,true, 0x502010FF);
|
||||||
|
|
||||||
GRRLIB_ObjectViewBegin();
|
GRRLIB_ObjectViewBegin();
|
||||||
GRRLIB_ObjectViewRotate(0.0f,0.0f,90.0f);
|
GRRLIB_ObjectViewRotate(0.0f,0.0f,90.0f);
|
||||||
GRRLIB_ObjectViewTrans(-1.3f,0.0f,0.0f);
|
GRRLIB_ObjectViewTrans(-1.3f,0.0f,0.0f);
|
||||||
GRRLIB_ObjectViewRotate(rot,rot*2,rot*3);
|
GRRLIB_ObjectViewRotate(rot,rot*2,rot*3);
|
||||||
GRRLIB_ObjectViewEnd();
|
GRRLIB_ObjectViewEnd();
|
||||||
GRRLIB_DrawCone(0.6f, 2.6f, 60,true, 0x502010FF);
|
GRRLIB_DrawCone(0.6f, 2.6f, 60,true, 0x502010FF);
|
||||||
|
|
||||||
GRRLIB_ObjectViewBegin();
|
GRRLIB_ObjectViewBegin();
|
||||||
GRRLIB_ObjectViewRotate(0.0f,0.0f,180.0f);
|
GRRLIB_ObjectViewRotate(0.0f,0.0f,180.0f);
|
||||||
GRRLIB_ObjectViewTrans(0.0f,-1.3f,0.0f);
|
GRRLIB_ObjectViewTrans(0.0f,-1.3f,0.0f);
|
||||||
GRRLIB_ObjectViewRotate(rot,rot*2,rot*3);
|
GRRLIB_ObjectViewRotate(rot,rot*2,rot*3);
|
||||||
GRRLIB_ObjectViewEnd();
|
GRRLIB_ObjectViewEnd();
|
||||||
GRRLIB_DrawCone(0.6f, 2.6f, 60,true, 0x502010FF);
|
GRRLIB_DrawCone(0.6f, 2.6f, 60,true, 0x502010FF);
|
||||||
|
|
||||||
GRRLIB_ObjectViewBegin();
|
GRRLIB_ObjectViewBegin();
|
||||||
GRRLIB_ObjectViewRotate(0.0f,0.0f,-90.0f);
|
GRRLIB_ObjectViewRotate(0.0f,0.0f,-90.0f);
|
||||||
GRRLIB_ObjectViewTrans(1.3f,0.0f,0.0f);
|
GRRLIB_ObjectViewTrans(1.3f,0.0f,0.0f);
|
||||||
GRRLIB_ObjectViewRotate(rot,rot*2,rot*3);
|
GRRLIB_ObjectViewRotate(rot,rot*2,rot*3);
|
||||||
GRRLIB_ObjectViewEnd();
|
GRRLIB_ObjectViewEnd();
|
||||||
GRRLIB_DrawCone(0.6f, 2.6f, 60,true, 0x502010FF);
|
GRRLIB_DrawCone(0.6f, 2.6f, 60,true, 0x502010FF);
|
||||||
|
|
||||||
GRRLIB_ObjectViewBegin();
|
GRRLIB_ObjectViewBegin();
|
||||||
GRRLIB_ObjectViewRotate(-90.0f,0.0f,0.0f);
|
GRRLIB_ObjectViewRotate(-90.0f,0.0f,0.0f);
|
||||||
GRRLIB_ObjectViewTrans(0.0f,0.0f,-1.3f);
|
GRRLIB_ObjectViewTrans(0.0f,0.0f,-1.3f);
|
||||||
GRRLIB_ObjectViewRotate(rot,rot*2,rot*3);
|
GRRLIB_ObjectViewRotate(rot,rot*2,rot*3);
|
||||||
GRRLIB_ObjectViewEnd();
|
GRRLIB_ObjectViewEnd();
|
||||||
GRRLIB_DrawCone(0.6f, 2.6f, 60,true, 0x502010FF);
|
GRRLIB_DrawCone(0.6f, 2.6f, 60,true, 0x502010FF);
|
||||||
|
|
||||||
GRRLIB_ObjectViewBegin();
|
GRRLIB_ObjectViewBegin();
|
||||||
GRRLIB_ObjectViewRotate(90.0f,0.0f,0.0f);
|
GRRLIB_ObjectViewRotate(90.0f,0.0f,0.0f);
|
||||||
GRRLIB_ObjectViewTrans(0.0f,0.0f,1.3f);
|
GRRLIB_ObjectViewTrans(0.0f,0.0f,1.3f);
|
||||||
GRRLIB_ObjectViewRotate(rot,rot*2,rot*3);
|
GRRLIB_ObjectViewRotate(rot,rot*2,rot*3);
|
||||||
GRRLIB_ObjectViewEnd();
|
GRRLIB_ObjectViewEnd();
|
||||||
GRRLIB_DrawCone(0.6f, 2.6f, 60,true, 0x502010FF);
|
GRRLIB_DrawCone(0.6f, 2.6f, 60,true, 0x502010FF);
|
||||||
|
|
||||||
GRRLIB_ObjectViewBegin();
|
GRRLIB_ObjectViewBegin();
|
||||||
GRRLIB_ObjectViewRotate(rot,rot*2,rot*3);
|
GRRLIB_ObjectViewRotate(rot,rot*2,rot*3);
|
||||||
GRRLIB_ObjectViewEnd();
|
GRRLIB_ObjectViewEnd();
|
||||||
GRRLIB_DrawCube( 0.6f, true, 0x102050FF);
|
GRRLIB_DrawCube( 0.6f, true, 0x102050FF);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue