Thank you for the support that they gave to me already the menu can make work with the bottom(fund) and the image in 3d I leave the code him(her) for if he(she) is interested in someone
#pragma warning( disable : 4244 4305 )
#include "DarkGDK.h"
#include "EZrotate.h"
// Functions:
// ---------------------------------------------
D3DXVECTOR3 RandomVectorPoint(int ObjNo);
void DarkGDK ( void )
{
// **********************
// Setup
dbSyncOn ( );
dbSyncRate (0);
dbBackdropOn ( );
dbAutoCamOff ( );
dbMaximiseWindow( );
dbSetWindowOff( );
dbSetDisplayMode( 1024, 768, 32 );
dbRandomize ( dbTimer() );
// **********************
// Load Objects:
// **********************
// Load 9 Asteroid Objects
// ---------------------------------------------
for (int a = 1; a <= 9; a++)
{
dbLoadObject ( "Media/AST_01.X", a);
dbSetObjectLight ( a, 0 );
}
// Position Asteroids in a Pattern
dbPositionObject ( 1, -150.0f, 150.0f, 0.0f );
dbPositionObject ( 2, 0.0f, 150.0f, 0.0f );
dbPositionObject ( 3, 150.0f, 150.0f, 0.0f );
dbPositionObject ( 4, -150.0f, 0.0f, 0.0f );
dbPositionObject ( 5, 0.0f, 0.0f, 0.0f );
dbPositionObject ( 6, 150.0f, 0.0f, 0.0f );
dbPositionObject ( 7, -150.0f, -150.0f, 0.0f );
dbPositionObject ( 8, 0.0f, -150.0f, 0.0f );
dbPositionObject ( 9, 150.0f, -150.0f, 0.0f );
// Make an EZrotate Euler and Matrix object for the asteroids to use
D3DXVECTOR3 Roid_Euler;
D3DXMATRIX Roid_Matrix;
// Define an EZrotate Vector array to store the rotation vector for each asteroid
D3DXVECTOR3 VPoint[10];
// Randomize the rotation vectors
for (int a = 1; a <= 9; a++)
{
VPoint[a] = RandomVectorPoint( a );
}
// Backdrop
// ---------------------------------------------
dbMakeObjectPlane ( 10, 2000.0f, 2000.0f );
dbPositionObject ( 10, 0.0f, 0.0f, 500.0f);
dbLoadImage ( "Media/space.jpg", 1 );
dbTextureObject ( 10, 1 );
// Camera
// ---------------------------------------------
dbPositionCamera ( 0.0f, 0.0f , -500.0f);
// **********************
// Main Loop:
// **********************
while ( LoopGDK ( ) )
{
if ( dbEscapeKey ( ) )
return;
// Re-Randomize rotation vectors
// ------------------------------
if ( dbSpaceKey() == 1)
{
for (int a = 1; a <= 9; a++)
{
VPoint[a] = RandomVectorPoint( a );
}
}
// Rotate Asteroids around their vectors
// --------------------------------------
for (int a = 1; a <= 9; a++)
{
//Setup EZrotate with the objects current rotation
Roid_Euler.x = dbObjectAngleX ( a );
Roid_Euler.y = dbObjectAngleY ( a );
Roid_Euler.z = dbObjectAngleZ ( a );
Roid_Matrix = EZro_Euler2Matrix ( Roid_Euler );
//Setup EZrotate with the objects current rotation
Roid_Matrix._41 = dbObjectPositionX ( a );
Roid_Matrix._42 = dbObjectPositionY ( a );
Roid_Matrix._43 = dbObjectPositionZ ( a );
//Use EZrotate to rotate the asteroid around its randomly generated vector
Roid_Matrix = EZro_Vector ( Roid_Matrix, VPoint[a], 1.0f );
//Get the new Euler values for the Asteroid
Roid_Euler = EZro_Matrix2Euler( Roid_Matrix );
//Apply the ROtation to the DBpro Object
dbRotateObject ( a, Roid_Euler.x, Roid_Euler.y, Roid_Euler.z );
}
// dbText ( 0,0,dbStr(dbScreenFPS()) );
dbText ( 0,10, "EZ-Rotate Enhanced for DGSDK" );
dbText ( 0,20, "Features Demo 2: Vector Rotation" );
dbText ( 0,30, "By: Ron Erickson" );
dbText ( 0,40, "visit: www.GameToolshed.com" );
dbText ( 0,50, "-------------------------------------------------------------" );
dbText ( 0,60, " SPACEBAR - Change Vector Point Locations" );
dbText ( 0,70, "-------------------------------------------------------------" );
dbText ( 0,80, "With Vector Rotation, you are no longer limited to rotating" );
dbText ( 0,90, "an object around one of it's axis. Instead, you can define" );
dbText ( 0,100, "any point and have the object rotate around an EZrotate created" );
dbText ( 0,110, "axis between the objects center and the point you define!" );
// dbText ( 0,120, " " );
dbText ( 0,130, "When you press the spacebar, a new axis is created for each" );
dbText ( 0,140, "asteroid. The asteroids then rotate around that new axis." );
dbSync ( );
}
}
D3DXVECTOR3 RandomVectorPoint(int ObjNo)
{
D3DXVECTOR3 RandomVector;
//Random X coordinate for Vector
RandomVector.x = dbRnd( 20 ) - 10 + dbObjectPositionX( ObjNo );
//Random Y coordinate for Vector
RandomVector.y = dbRnd( 20 ) - 10 + dbObjectPositionY( ObjNo );
//Random Z coordinate for Vector
RandomVector.z = dbRnd( 20 ) - 10 + dbObjectPositionZ( ObjNo );
return RandomVector;
}