You are not logged in.

#1 2010-11-02 13:07:40

mdbrim
Member

3d viewpoint help.

I have dice that i throw on a table that bounce around with some physics.  That part looks great.  In the top corner of the screen, i have a little window set a side where i want to display the results of the dice (since the ones on the table are kinda small).

So i was able to recreate the angles (quaternoins) of the physics bouncing dice into two dice that display the same as the ones on the table.  The effect is awesome as it shows the dice jumbling around during the roll and in mimics everything the real dice do.  But, because of the way i had to position them in space to have them show up in the top left, the angle is all based on the original viewpoint of the table.

What i would like to do is have a view from above the dice looking down so the top face is what we see.

www.brimble.com/hbb/3ddice.dol

hit the b button to roll and you'll see what i mean.  Is there a way to have another 3dview point for just those dice in the top left?

I would manually adjust the angles of the top dice, but that's a bit tough since the reference plane is changing with every roll, that and i'm using quaternoins as the draw portion and i'm at a loss on how to adjust them individually (the physics engine does it for me now).

Offline

 

#2 2010-11-07 06:39:56

mdbrim
Member

Re: 3d viewpoint help.

ok well i thought i was on to something... an idea... but it no working...

So i figured i'll just draw my dice in one 3d view, screen capture that view to a texture with screen2texture, then change 3d view to my regular view, display dice and image of my top down view... but it doesn't seem to want to switch camera settings back and forth.

I have the following setup.

Code:

GRRLIB_CameraSettings(0,50,5, 0,1,0, 0,0,0);  //My top down view for just the dice.
Then my code to draw the dice.
Then after GX_End;
GRRLIB_Screen2Texture(0,0,img_diceview, true);

GRRLIB_CameraSettings(0,50,45, 0,1,0 0,0,0); //set it back to my regular view.
Draw my bouncing table dice
GRRLIB_2dMode();
GRRLIB_DrawImg(0,0,img_diceview,0,1,1,0xFFFFFFFF); //draw my stored texture.
GRRLIB_Render();

The top down works, but it doesn't change views for my regular bouncing dice and just shows the same camera angle as my top down. IE it never switches back to taht 0,50,45 angle in the second CameraSettings.

Ideas?

Edit:  Temp solution.  using the view of (0,50,45) which is my regular game view, i can get a NEAR top down view of the dice by putting them at the VERY bottom of screen:

Code:

GRRLIB_CameraSettings((0,50,45, 0,1,0 0,0,0);   //my regular view
The code to draw the dice, but this time draw them at the very bottom of the screen resulting in a near top down view.
Then after GX_End;
GRRLIB_Screen2Texture(300, 360, img_diceview, true);  //captures that bottom portion of the screen where the dice are.

Draw my bounching table dice // no need to change the camerasettigns this time.
GRRLIB_2dMode();
GRRLIB_DrawImg(0,0,img_diceview,0,1,1,0xFFFFFFFF); //draw my stored texture from the bottom back up top.
GRRLIB_Render();

So i just draw it at the very bottom and screen capture that section and then place the resulting image back up top. and draw the rest of my scene.  It works perfect, just not exactly top down like a new view angle would give me. So if any one knows how to change camera angles let me know!

Last edited by mdbrim (2010-11-07 14:12:30)

Offline

 

Board footer

Powered by FluxBB