tenpoundbear

Members
  • Content count

    129
  • Joined

  • Last visited

Community Reputation

167 Neutral

About tenpoundbear

  • Rank
    Member
  1. Hi guys, So I have this little solution with 3 projects and when I compile I am getting a linking error. I am using Visual Studio 2010 by the way. [quote] 1.error LNK2019:unresolved external symbol_func_2 referenced in function "void_cdecl func_1(void)"(?func_1@@YAXXZ) 2.error LNK1120: unresolved externals [/quote] I am not sure why and it has been bothering me for days. The solution is just exporting some DLL's, very simple! ****** Project 1 ************** SHARETAP32.H [CODE] #ifdef DLLEXPORTIMPORT #define EXPORT_IMPORT _declspec(dllexport) #else #define EXPORT_IMPORT _declspec(dllimport) #endif extern "C" void EXPORT_IMPORT Func_2( int a ); [/CODE] SHARETAP32.CPP [CODE] #define DLLEXPORTIMPORT #include "sharetap32.h" void func_2( int a ) { // Stub for now! } [/CODE] ****** Project 1 ************** ****** Project 2 ************** WINDEF32.H [CODE] #ifdef DLLEXPORTIMPORT #define EXPORT_IMPORT _declspec(dllexport) #else #define EXPORT_IMPORT _declspec(dllimport) #endif extern "C" void EXPORT_IMPORT Func_1(); [/CODE] WINDEF32.CPP [CODE] #define DLLEXPORTIMPORT #include "windef32.h" [/CODE] ****** Project 2 ************** ****** Project 3 ************** WINTAP32.H [CODE] struct Person { char *name; int age; }; [/CODE] WINDEF32.CPP [CODE] #include "wintap32.h" #include "sharetap32\sharetap32.h" void Func_1() { func_2( 3 ); } [/CODE] ****** Project 3 ************** Do you guys know what the issue is? I am pretty sure it is due to the func_2( int a ) but I am not sure.
  2. Hey guys, So I have been reading procedural content generation, particularly in regards to creating something on the scale of the universe/galaxies, and while there are some information out there I am having difficulty finding information on how it is implemented. Not an accurate one, just one that is 'fun'. The theory sounds good. But thinking about it I am not sure how it works when applied to my own project . If I wanted to create a galaxy that contains many star systems, I would do something like... Start of with a seed... This would then return a set of seemingly random numbers, eg 12 17 188 2 38 47 88 blah blah blah How can I turn those numbers into something meaningful, something I can use? I mean, what would '12' represent? The number of stars systems in a galaxy? The position of a star? Number of moons? I am not sure how to start off... Cheers Guys
  3. Hi Guys, So I am reading this article 'Algorithms for an Infinite Universe' by Guy Lecky-Thompson on Gamasutra site and I just need some clarification. The article talks about generating a universe using PRNG algorithm. The link can be found here by the way [url="http://www.gamasutra.com/view/feature/3377/algorithms_for_an_infinite_universe.php?print=1"]http://www.gamasutra...rse.php?print=1[/url] I understand everything up until Listing 3. [code] int Universe::StarAt (unsigned long ulXPosition, unsigned long ulYPosition, unsigned long ulSerialNumber) { unsigned long ulRandomValue; // Set up the serial number for this grid reference ulSerialNumber = ((ulYPosition + 1) * this->ulXDimension) + ulXPosition); for (unsigned long ulCounter = 0; ulCounter < ulSerialNumber; ulCounter++) { ulRandomValue = this->prRandomizer->PseudoRandom(); } // If ulRandomValue falls in the lower 1%, there is a star here if (ulRandomValue <= ((this->ulXDimension * this->ulYDimension) / 100)) return 1; return 0; } [/code] I don't understand the purpose of the 'ulSerialNumber' variable. From reading the article the serial number is used so that the same instance of the universe can be recreated each time? And then it goes into a loop... I don't understand the loop's purpose since the 'ulRandomValue' value gets saved at the last iteration in the loop. Was the loop necessary at all? Many thanks guys.
  4. Memory Leak Hunt

    Hey guys, I have been trying to see where I have memory leaks... I know I have 4, and I think I know roughly where abouts they are coming from. It just that I don't know why they are there because I have released them, to the best of my knowledge at least. If you guys are able to tell me where I haven't or if there is something I overlooked. My code compiles fine. I do apologise for lots of code (although I've omitted irrelevant ones out), but I hope you can give me some help. As always guys, can't thank enough. MAIN APPLICATION ENTRY [code] //.. Omitted some includes #include "BaseWindow.h" #include "Direct3DDevice.h" #include "Camera.h" #include "Direct3DInput.h" #include "Sector.h" #ifdef _DEBUG #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) #define new DEBUG_NEW #endif #define D3DXToRadian( degree ) (( degree ) * ( D3DX_PI / 180.0f )) #define D3DXToDegree( radian ) (( radian ) * ( 180.0f / D3DX_PI )) BaseWindow* baseWindow = NULL; IDirect3DDevice9* D3DDevice = NULL; Direct3DDevice* direct3DDevice = NULL; Camera* camera = NULL; Direct3DInput* direct3DInput = NULL; Sector *sector = NULL; ID3DXMesh* mesh = NULL; //--- Function Prototypes ---// //.. Omitted code int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) { _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); //... Code Omitted // THIS IS WHERE MY MEMORY LEAK STARTS // BECAUSE IF I COMMENT THIS OUT... I GET NO MEMORY LEAKS sector = new Sector( "Earth Sector", &D3DDevice ); //... Code Omitted MSG msg; ZeroMemory( &msg, sizeof( MSG )); //... Code Omitted while( msg.message != WM_QUIT ) { if( PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) { TranslateMessage( &msg ); DispatchMessage( &msg ); } else { LARGE_INTEGER currentTimeCount; QueryPerformanceCounter( &currentTimeCount ); float timeElapsed = ( currentTimeCount.QuadPart - lastTimeCount.QuadPart ) / ( float ) frequency.QuadPart; timeBank += timeElapsed; while( timeBank > timeStep ) { updateGame( timeStep ); timeBank -= timeStep; } renderGame(); Yield(); } } cleanUp(); return 0; } void getInput() { //... Code Omitted } void renderGame() { D3DXMATRIX myTranslate; D3DDevice->Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB( 205, 205, 255 ), 1.0f, 0 ); D3DDevice->Clear( 0, NULL, D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB( 205, 205, 255 ), 1.0f, 0 ); if( SUCCEEDED( D3DDevice->BeginScene() )) { //... Code Omitted } else MessageBox( 0, "FAILED - BeginScene", 0, 0 ); D3DDevice->EndScene(); D3DDevice->Present( NULL, NULL, NULL, NULL ); } void updateGame( float timeStep ) { //.. Code Omitted } void cleanUp() { // Releases resources (eg. memory, DirectX objects). if( mesh != NULL ) { mesh->Release(); mesh = NULL; } if( sector != NULL ) { delete sector; sector = NULL; } if( direct3DInput != NULL ) { delete direct3DInput; direct3DInput = NULL; } if( camera != NULL ) { delete camera; camera = NULL; } if( direct3DDevice != NULL ) { delete direct3DDevice; direct3DDevice = NULL; } if( D3DDevice != NULL ) { D3DDevice->Release(); D3DDevice = NULL; } if( baseWindow != NULL ) { delete baseWindow; baseWindow = NULL; } [/code] SECTOR CODE [code] // --------------- HEADER --------------------- // #ifndef SECTOR_H #define SECTOR_H //.. Omitted some includes #include "Sky_Singleton.h" class Sector { public: ~Sector(); Sector( char *name, IDirect3DDevice9 **D3DDevice ); Sky_Singleton *getSingleton(); private: char *name; IDirect3DTexture9 *texture; Sky_Singleton *singleton; }; #endif // -------------- CPP FILE --------------------- // #include "Sector.h" #include <stdio.h> Sector::~Sector() { if( name != NULL ) { delete[] name; name = NULL; } if( texture != NULL ) { texture->Release(); texture = NULL; } if( singleton != NULL ) { delete singleton; singleton == NULL; } Sector::Sector( char *name, IDirect3DDevice9 **D3DDevice ) { this->name = new char[ strlen( name ) + 1 ]; strcpy( this->name, name ); texture = NULL; singleton = Sky_Singleton::getInstance( &(*D3DDevice) ); } //.. Function Omitted [/code] SKY_SINGLETON CODE [code] #ifndef SKY_SINGLETON_H #define SKY_SINGLETON_H //.. Omitted some includes #include "Skydome.h" class Sky_Singleton { public: static Sky_Singleton *getInstance( IDirect3DDevice9 **D3DDevice ); static SpaceObject *getSky( IDirect3DDevice9 **D3DDevice ); SpaceObject *getSkydome(); private: Sky_Singleton( IDirect3DDevice9 **D3DDevice ); static Sky_Singleton *instance_sky_singleton; static SpaceObject *skydome; }; #endif // ----------------------- CPP FILE --------------------- // #include "Sky_Singleton.h" #include <stdio.h> Sky_Singleton *Sky_Singleton::instance_sky_singleton = NULL; SpaceObject *Sky_Singleton::skydome = NULL; Sky_Singleton::Sky_Singleton( IDirect3DDevice9 **D3DDevice ) { skydome = new Skydome( "Sky_Singleton", 20.0f, 15.0f, 15.0f ); skydome->calculateVertexData(); skydome->calculateIndexData(); skydome->calculateTextureCoord(); skydome->fixTexture(); skydome->initBuffer( &(*D3DDevice) ); skydome->loadTexture( &(*D3DDevice), "Asset/Stars4.jpg" ); } Sky_Singleton *Sky_Singleton::getInstance( IDirect3DDevice9 **D3DDevice ) { if( instance_sky_singleton == NULL ) instance_sky_singleton = new Sky_Singleton( &(*D3DDevice) ); return instance_sky_singleton; } SpaceObject *Sky_Singleton::getSky( IDirect3DDevice9 **D3DDevice ) { if( instance_sky_singleton == NULL ) instance_sky_singleton = new Sky_Singleton( &(*D3DDevice) ); return skydome; } SpaceObject *Sky_Singleton::getSkydome() { return skydome; } [/code] SPACEOBJECT CODE [code] // -------------------- HEADER --------------- // #ifndef SPACEOBJECT_H #define SPACEOBJECT_H //.. Omitted some includes #include "Vertex.h" class SpaceObject { public: virtual ~SpaceObject(); SpaceObject( char* name ); //.. Functions Omitted protected: char* name; int numOfVertices; Vertex *spaceObject; IDirect3DTexture9 *texture; IDirect3DVertexBuffer9 *VB; IDirect3DIndexBuffer9 *IB; short *indices; D3DXVECTOR3 position; }; #endif //--------------------- CPP FILE ------------------- // #include "SpaceObject.h" #include <stdio.h> SpaceObject::~SpaceObject() { if( name != NULL ) { delete[] name; name = NULL; } if( spaceObject != NULL ) { delete spaceObject; spaceObject = NULL; } if( texture != NULL ) { texture->Release(); texture = NULL; } if( VB != NULL ) { VB->Release(); VB = NULL; } if( IB != NULL ) { IB->Release(); IB = NULL; } if( indices != NULL ) { delete indices; indices = NULL; } } SpaceObject::SpaceObject( char *name ) { this->name = new char[ strlen( name ) + 1 ]; strcpy( this->name, name ); VB = NULL; texture = NULL; position = D3DXVECTOR3( 0.0f, 0.0f, 0.0f ); } //.. Functions Omitted [/code] SKYDOME CODE [code] // ----------- HEADER ------------------ // #ifndef SKYDOME_H #define SKYDOME_H //.. Includes Omitted #include "Vertex.h" #include "SpaceObject.h" class Skydome: public SpaceObject { public: ~Skydome(); Skydome( char* name, float radius, float slice, float segment ); //.. Functions Omitted private: int northVertexOffset_start; int northVertexOffset_end; int northPoleTriNum; int southVertexOffset_start; int southVertexOffset_end; int southPoleTriNum; int middleVertexOffset_start; int middleVertexOffset_end; int middleTriNum; float radius, slice, segment; int IBSize; }; #endif //---------------- CPP FILE -------------------- // #include "SkyDome.h" #include <stdio.h> Skydome::~Skydome() {} Skydome::Skydome( char* name, float radius, float slice, float segment ): SpaceObject( name ) { //.. Code Omitted } void Skydome::calculateVertexData() { //.. Code Omitted } void Skydome::calculateIndexData() { //.. Code Omitted } void Skydome::calculateTextureCoord() { //.. Code Omitted } void Skydome::fixTexture() { //.. Code Omitted } void Skydome::initBuffer( IDirect3DDevice9** D3DDevice ) { //.. Code Omitted } void Skydome::computeNormal( D3DXVECTOR3 p0, D3DXVECTOR3 p1, D3DXVECTOR3 p2, D3DXVECTOR3* out ) { //.. Code Omitted } void Skydome::computeNormal( ) {} void Skydome::render( IDirect3DDevice9** D3DDevice ) { //.. Code Omitted } [/code]
  5. Singleton Help

    Thanks guys There was an extra method that I had that seemed to be the cause of the problem. After commenting it out it compiled fine Thanks for the copy and paste tip into notepad... I will try that next time Very much appreciated guys
  6. Singleton Help

    Yeh I've tried that actually... still same errors. I show the complete list off errors I get, [quote] [size="1"] error C2143: syntax error : missing ';' before '*' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2373: 'Sky_Singleton' : redefinition; different type modifiers: see declaration of 'Sky_Singleton' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2556: 'int *Sky_Singleton::getInstance(void)' : overloaded function differs only by return type from 'Sky_Singleton *Sky_Singleton::getInstance(void)': see declaration of 'Sky_Singleton::getInstance' error C2371: 'Sky_Singleton::getInstance' : redefinition; different basic types: see declaration of 'Sky_Singleton::getInstance' [/size] [/quote] When I use the <> button... I get a WHOLE HEAP of extra tags that just messes up my code. (eg. I have cleaned up most of it but at the bottom I have left some behind to show you what I mean... it's just annoying that I have to delete the extra tags when I use that <> button).
  7. Singleton Help

    Hey guys, I got this set of code for a singleton class and I am getting compile errors and I am not what the problem is... If you can look and tell me what I did wrong I be very happy [size="2"][color="#0000ff"][size="2"][color="#0000ff"][code] #ifndef SKY_SINGLETON_H #define SKY_SINGLETON_H #include <d3d9.h> #include <d3dx9.h> #include "Skydome.h" class Sky_Singleton { public: Sky_Singleton *getInstance(); private: Sky_Singleton(); static Sky_Singleton *instance_sky_singleton; SpaceObject *skydome; }; [/size][size="2"][color="#0000ff"][size="2"][color="#0000ff"]#endif [/color][/size][/color][/size][/code][/color][/size][/color][/size] [size="2"][color="#0000ff"][size="2"][color="#0000ff"] [size="2"][color="#0000ff"][size="2"][color="#0000ff"][/color][/size][/color][/size]#include[/color][/size][/color][/size][size="2"] [/size][size="2"][color="#a31515"][size="2"][color="#a31515"]"Sky_Singleton.h" [/color][/size][/color][/size][size="2"]Sky_Singleton* Sky_Singleton::instance_sky_singleton = NULL; [/size][size="2"]Sky_Singleton::Sky_Singleton() {[/size][size="2"]} Sky_Singleton *Sky_Singleton::getInstance() { [/size][size="2"][color="#0000ff"][size="2"][color="#0000ff"]if[/color][/size][/color][/size][size="2"]( instance_sky_singleton == NULL ) instance_sky_singleton = [/size][size="2"][color="#0000ff"][size="2"][color="#0000ff"]new[/color][/size][/color][/size][size="2"] Sky_Singleton(); [/size][size="2"][color="#0000ff"][size="2"][color="#0000ff"]return[/color][/size][/color][/size][size="2"] instance_sky_singleton; } [/source] Error I am getting is something like this [quote][size="1"]error C2556: 'int *Sky_Singleton::getInstance(void)' : overloaded function differs only by return type from 'Sky_Singleton *Sky_Singleton::getInstance(void)' [/size][/quote] Thanks guys... been stuck on this for few hours. P. S. [code] and source tags no longer work?[/size]
  8. Texture Cube with Index Buffer

    Because I am brainless it appears HEHEHE... yeh that was the issue... don't know what I was thinking But its fixed now Thanks heaps
  9. Hey Guys, I am drwing a cube with a texture on it using index buffer. Unfortunately, the last side of the cude isn't showing the texture correctly... the 5 other sides are showing it fine. I've checked the texture cordinates for the last 2 hours... don't know what the problem is sadly. [img]http://img651.imageshack.us/img651/3309/texturecubeindex.jpg[/img] This is the bulk of the code for the cube. [code][source] //back planet[ 0 ].vertex = D3DXVECTOR3( -5.0f, -5.0f, 30.0f ); planet[ 0 ].normal = D3DXVECTOR3( 0.0f, 0.0f, 1.0f ); planet[ 1 ].vertex = D3DXVECTOR3( -5.0f, 5.0f, 30.0f ); planet[ 1 ].normal = D3DXVECTOR3( 0.0f, 0.0f, 1.0f ); planet[ 2 ].vertex = D3DXVECTOR3( 5.0f, 5.0f, 30.0f ); planet[ 2 ].normal = D3DXVECTOR3( 0.0f, 0.0f, 1.0f ); planet[ 3 ].vertex = D3DXVECTOR3( 5.0f, -5.0f, 30.0f ); planet[ 3 ].normal = D3DXVECTOR3( 0.0f, 0.0f, 1.0f ); //front planet[ 4 ].vertex = D3DXVECTOR3( -5.0f, -5.0f, 20.0f ); planet[ 4 ].normal = D3DXVECTOR3( 0.0f, 0.0f, -1.0f ); planet[ 5 ].vertex = D3DXVECTOR3( -5.0f, 5.0f, 20.0f ); planet[ 5 ].normal = D3DXVECTOR3( 0.0f, 0.0f, -1.0f ); planet[ 6 ].vertex = D3DXVECTOR3( 5.0f, 5.0f, 20.0f ); planet[ 6 ].normal = D3DXVECTOR3( 0.0f, 0.0f, -1.0f ); planet[ 7 ].vertex = D3DXVECTOR3( 5.0f, -5.0f, 20.0f ); planet[ 7 ].normal = D3DXVECTOR3( 0.0f, 0.0f, -1.0f ); //bottom planet[ 8 ].vertex = D3DXVECTOR3( -5.0f, -5.0f, 20.0f ); planet[ 8 ].normal = D3DXVECTOR3( 0.0f, -1.0f, 0.0f ); planet[ 9 ].vertex = D3DXVECTOR3( -5.0f, -5.0f, 30.0f ); planet[ 9 ].normal = D3DXVECTOR3( 0.0f, -1.0f, 0.0f ); planet[ 10 ].vertex = D3DXVECTOR3( 5.0f, -5.0f, 30.0f ); planet[ 10 ].normal = D3DXVECTOR3( 0.0f, -1.0f, 0.0f ); planet[ 11 ].vertex = D3DXVECTOR3( 5.0f, -5.0f, 20.0f ); planet[ 11 ].normal = D3DXVECTOR3( 0.0f, -1.0f, 0.0f ); //top planet[ 12 ].vertex = D3DXVECTOR3( -5.0f, 5.0f, 20.0f ); planet[ 12 ].normal = D3DXVECTOR3( 0.0f, 1.0f, 0.0f ); planet[ 13 ].vertex = D3DXVECTOR3( -5.0f, 5.0f, 30.0f ); planet[ 13 ].normal = D3DXVECTOR3( 0.0f, 1.0f, 0.0f ); planet[ 14 ].vertex = D3DXVECTOR3( 5.0f, 5.0f, 30.0f ); planet[ 14 ].normal = D3DXVECTOR3( 0.0f, 1.0f, 0.0f ); planet[ 15 ].vertex = D3DXVECTOR3( 5.0f, 5.0f, 20.0f ); planet[ 15 ].normal = D3DXVECTOR3( 0.0f, 1.0f, 0.0f ); //right side planet[ 16 ].vertex = D3DXVECTOR3( 5.0f, -5.0f, 20.0f ); planet[ 16 ].normal = D3DXVECTOR3( 1.0f, 0.0f, 0.0f ); planet[ 17 ].vertex = D3DXVECTOR3( 5.0f, 5.0f, 20.0f ); planet[ 17 ].normal = D3DXVECTOR3( 1.0f, 0.0f, 0.0f ); planet[ 18 ].vertex = D3DXVECTOR3( 5.0f, 5.0f, 30.0f ); planet[ 18 ].normal = D3DXVECTOR3( 1.0f, 0.0f, 0.0f ); planet[ 19 ].vertex = D3DXVECTOR3( 5.0f, -5.0f, 30.0f ); planet[ 19 ].normal = D3DXVECTOR3( 1.0f, 0.0f, 0.0f ); //left side planet[ 20 ].vertex = D3DXVECTOR3( -5.0f, -5.0f, 20.0f ); planet[ 20 ].normal = D3DXVECTOR3( -1.0f, 0.0f, 0.0f ); planet[ 21 ].vertex = D3DXVECTOR3( -5.0f, 5.0f, 20.0f ); planet[ 21 ].normal = D3DXVECTOR3( -1.0f, 0.0f, 0.0f ); planet[ 22 ].vertex = D3DXVECTOR3( -5.0f, 5.0f, 30.0f ); planet[ 22 ].normal = D3DXVECTOR3( -1.0f, 0.0f, 0.0f ); planet[ 23 ].vertex = D3DXVECTOR3( -5.0f, -5.0f, 30.0f ); planet[ 23 ].normal = D3DXVECTOR3( -1.0f, 0.0f, 0.0f ); //back planet[ 0 ].tu = 0.0f; planet[ 0 ].tv = 1.0f; planet[ 1 ].tu = 0.0f; planet[ 1 ].tv = 0.0f; planet[ 2 ].tu = 1.0f; planet[ 2 ].tv = 0.0f; planet[ 3 ].tu = 1.0f; planet[ 3 ].tv = 1.0f; //front planet[ 4 ].tu = 0.0f; planet[ 4 ].tv = 1.0f; planet[ 5 ].tu = 0.0f; planet[ 5 ].tv = 0.0f; planet[ 6 ].tu = 1.0f; planet[ 6 ].tv = 0.0f; planet[ 7 ].tu = 1.0f; planet[ 7 ].tv = 1.0f; //bottom planet[ 8 ].tu = 0.0f; planet[ 8 ].tv = 1.0f; planet[ 9 ].tu = 0.0f; planet[ 9 ].tv = 0.0f; planet[ 10 ].tu = 1.0f; planet[ 10 ].tv = 0.0f; planet[ 11 ].tu = 1.0f; planet[ 11 ].tv = 1.0f; //top planet[ 12 ].tu = 0.0f; planet[ 12 ].tv = 1.0f; planet[ 13 ].tu = 0.0f; planet[ 13 ].tv = 0.0f; planet[ 14 ].tu = 1.0f; planet[ 14 ].tv = 0.0f; planet[ 15 ].tu = 1.0f; planet[ 15 ].tv = 1.0f; //r side planet[ 16 ].tu = 0.0f; planet[ 16 ].tv = 1.0f; planet[ 17 ].tu = 0.0f; planet[ 17 ].tv = 0.0f; planet[ 18 ].tu = 1.0f; planet[ 18 ].tv = 0.0f; planet[ 19 ].tu = 1.0f; planet[ 19 ].tv = 1.0f; //l side planet[ 20 ].tu = 1.0f; planet[ 20 ].tv = 1.0f; planet[ 21 ].tu = 1.0f; planet[ 21 ].tv = 0.0f; planet[ 22 ].tu = 0.0f; planet[ 22 ].tv = 0.0f; planet[ 23 ].tu = 0.0f; planet[ 23 ].tv = 1.0f; //INDEX //back indices[ 0 ] = 0; indices[ 1 ] = 1; indices[ 2 ] = 2; indices[ 3 ] = 0; indices[ 4 ] = 2; indices[ 5 ] = 3; //front indices[ 6 ] = 4; indices[ 7 ] = 5; indices[ 8 ] = 6; indices[ 9 ] = 4; indices[ 10 ] = 6; indices[ 11 ] = 7; //bottom indices[ 12 ] = 8; indices[ 13 ] = 9; indices[ 14 ] = 10; indices[ 15 ] = 8; indices[ 16 ] = 10; indices[ 17 ] = 11; //top indices[ 18 ] = 12; indices[ 19 ] = 13; indices[ 20 ] = 14; indices[ 21 ] = 12; indices[ 22 ] = 14; indices[ 23 ] = 15; //right indices[ 24 ] = 16; indices[ 25 ] = 17; indices[ 26 ] = 18; indices[ 27 ] = 16; indices[ 28 ] = 18; indices[ 29 ] = 19; //left indices[ 30 ] = 0; indices[ 31 ] = 1; indices[ 32 ] = 5; indices[ 33 ] = 0; indices[ 34 ] = 5; indices[ 35 ] = 4; [/code] It has to be a texture cordinate problem?
  10. Blending - I am confused.

    So I have been experimenting with some code and revising my information.. and I think where I was getting confused was at the point where I can decide the source and destination blend types. I think I just got bit confused with 'D3DBLEND_SRCCOLOR' and 'D3DBLEND_INVSRCALPHA'. Anguelov's diagram is indicating the use of 'D3DBLEND_SRCCOLOR' I think, originally when I was looking at it I thought he was using the alpha channel for the source. Anyways, I am was asking this question because I wanted to know what strategy I can employ to in order to draw a texture of a planet on top of a space background. I have already drawn the space background. My planet texture is a square... but the planet is a circle, hence I don't want you see the whole texture. I just want the circle part where the planet is to be seen and for the space background to be seen through. I way I am thinking about is just me the non-planet section of the texture transparent... will this work? So when I draw it... only the planet is seen... and the space background will show through around it. Any suggestion is appreciated
  11. Hey guys, I am reading up on blending. At the moment I am concentrating on information from 2 different sources, and they seem to contradict each other. I was wondering if you guys can clear up the confusion for me... According to Frank Luna. (2003). Introduction to 3D Game Programming With DirectX 9.0. Wordware Publishing, "Thus, pixels with a black (0) alpha value are completely transparent, pixels with a gray alpha value of (128) are 50% transparent, and pixels with a white alpha value of (255) are completely opaque." But then Bobby Anguelov. (2010). DirectX10 Tutorial 6: Blending and Alpha Blending. Retrieved February 02, 2011 from http://takinginitiative.net/2010/04/09/directx-10-tutorial-6-transparency-and-alpha-blending/ seems to indicate the opposite of what Frank says. Looking at the diagram, 'Blending Example', it seems Bobby's tutorial indicates that black is fully opaque, whilst white is transparent. So I am a bit confused... is anyone able to clear this up for me? Many thanks guys.
  12. My texture is too close to the screen help

    Yep... I have been experimenting with wider dimensions... So far 10 000pixel wide gives me a better result. 10 000pixel wide and 4000 pixel high is not too much is it? It sounds big... the file is 4MB. That isn't a issue? Thanks :)
  13. My texture is too close to the screen help

    What should I do in that case? My aim is not really to see more of the texture... but rather to not have the texture so that it seems like I am looking at it at 1cm away from my eyes.
  14. Hi guys, I have my texture (on a sphere) and when I ran my application it is too close to the screen. My camera is position to be in the centre of the sphere. But no matter what I do it is always at the same distance. I tried making the sphere larger so that the texture would look further away. Although my sphere geometry is bigger, and therefore the distance from centre to edge should also be greater... but the texture is still close to the screen. My image dimension is 6000 by 2000 pixels. My window size is 1280 by 720 pixels. I have tried with other images of different dimensions and its all the same.... texture too close to screen. I have set these settings for the textures in my application... but I don't that is the issue. void Direct3DDevice::setDeviceState_SAMPLE( IDirect3DDevice9** D3DDevice ) { ( *D3DDevice )->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_ANISOTROPIC ); ( *D3DDevice )->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_ANISOTROPIC ); ( *D3DDevice )->SetSamplerState( 0, D3DSAMP_MAXANISOTROPY, 4 ); } void Direct3DDevice::setDeviceState_MIPMAP( IDirect3DDevice9** D3DDevice ) { ( *D3DDevice )->SetSamplerState( 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT ); } This is what my running application looks like. This is what my image looks like. Do you guys know why? Many thanks guys :)
  15. How to get my sky to be centre of world?

    That's the thing... I don't actually have a position variable for my skydome. I can add one (did think of that) but than I was thinking how about my geometry, I mean all the vertices that make up the skydome? Do I have do also change them? Hmmm... do you know what I mean...