# ShurikeN

Member

14

122 Neutral

• Rank
Member
1. ## i need your Opinion (book)

i need your opinion about these two DirectX books "Beginning DirectX 9 by W.Jones" and "Intro to 3D Game Programming with DirectX 9 by Frank Luna" im confused i don't know which one i should buy. for those who have read them, which do you think is better and well-explained??
2. ## Scaling problem (3D max and DirectX)

it's been 4hrs since i woke up in the morning and been working on this but still i couldn't find the solution to this problem, thanks to this my day is ruined. SCREENSHOT http://www.geocities.com/cursebox87/SCREENSHOT2.JPG
3. ## Scaling problem (3D max and DirectX)

thanks for the replies. yeah, i could scale it in coding but i don't wanna do that. anyways, i have to sleep now. im so tired trying to fix this sh!t, im gonna continue this tomorrow.
4. ## Scaling problem (3D max and DirectX)

Quote:Original post by darookie In short: there's nothing wrong, your program is just using a different setup for the coordinate system and hence the units aren't scaled the same way. so, how do i make the correct setup?? Quote: You need to use a scale factor to convert them to your program's virtual units. i didn't understand much what you mean by that. you mean D3DXMatrixScaling() ??
5. ## Scaling problem (3D max and DirectX)

i was trying to make a big terrain map in 3D Studio Max with a length and width of 2000 but when i render it in Direct3D App. the length and width changes in size, it becomes small. screenshot http://www.geocities.com/cursebox87/screenshot.JPG [Edited by - ShurikeN on April 1, 2008 10:27:52 PM]
6. ## im so weak in math/physics!!

so im gonna need a collision library. What's the best out there?? by the way, im a beginner in the 3D World (DirectX), so when i say "best" it should mean well-documented and beginner-friendly.
7. ## [HELP] Color probs

anyone??? i have another question: what does D3DXMatrixIdentity do?? what's the difference if i do not include it in this code? void Draw_Grid() { D3DXMATRIX matWorld; D3DXMatrixIdentity(&matWorld); pD3DDevice->SetTransform(D3DTS_WORLD,&matWorld); tVector3 vertData[2]; for(float i = -500; i <= 500; i += 5) { // draw line in x direction vertData[0] = tVector3(-500, 0, i); vertData[0].color = 0xFFD9810E; vertData[1] = tVector3( 500, 0, i); vertData[1].color = 0xFFD9810E; pD3DDevice->DrawPrimitiveUP(D3DPT_LINELIST, 1, &vertData, sizeof( vertData[0] ) ); // draw line in z direction vertData[0] = tVector3(i, 0,-500); vertData[0].color = 0xFFD9810E; vertData[1] = tVector3(i, 0, 500); vertData[1].color = 0xFFD9810E; pD3DDevice->DrawPrimitiveUP(D3DPT_LINELIST, 1, &vertData, sizeof( vertData[0] ) ); } }
8. ## [HELP] Color probs

doesn't work either.
9. ## [HELP] Color probs

the color of my grid lines doesn't seem to work. i tried changing it to almost any color but it's ineffective. here's the screenshot http://www.geocities.com/cursebox87/spaceship.JPG and here's my code: void DrawGrid() { tVector3 vertData[2]; for(float i = -500; i <= 500; i += 5) { vertData[0] = tVector3(-500, 0, i); vertData[0].color = D3DCOLOR_XRGB(255,0,255); vertData[1] = tVector3( 500, 0, i); vertData[1].color = D3DCOLOR_XRGB(255,0,255); d3ddev->DrawPrimitiveUP(D3DPT_LINELIST, 1, &vertData, sizeof( vertData[0] ) ); //z direction vertData[0] = tVector3(i, 0,-500); vertData[0].color = D3DCOLOR_XRGB(255,0,255); vertData[1] = tVector3(i, 0, 500); vertData[1].color = D3DCOLOR_XRGB(255,0,255); d3ddev->DrawPrimitiveUP(D3DPT_LINELIST, 1, &vertData, sizeof( vertData[0] ) ); } } void InitD3D(HWND hwnd) { d3d = Direct3DCreate9 (D3D_SDK_VERSION); D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = true; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.hDeviceWindow = hwnd; d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8; d3dpp.BackBufferWidth = SCREEN_WIDTH; d3dpp.BackBufferHeight = SCREEN_HEIGHT; d3dpp.EnableAutoDepthStencil = true; d3dpp.AutoDepthStencilFormat = D3DFMT_D16; d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddev); InitGraphics(); InitLight(); d3ddev->SetRenderState(D3DRS_LIGHTING, true); d3ddev->SetRenderState(D3DRS_ZENABLE, true); d3ddev->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_XRGB(50, 50, 50)); return; } void InitGraphics() { LPD3DXBUFFER bufferObjectMaterial; D3DXLoadMeshFromX("spaceship.x", D3DXMESH_SYSTEMMEM, d3ddev, NULL, &bufferObjectMaterial, NULL, &numMaterials, &meshObject); D3DXMATERIAL* tempMaterials = (D3DXMATERIAL*)bufferObjectMaterial->GetBufferPointer(); Material = new D3DMATERIAL9[numMaterials]; for(DWORD i = 0; i < numMaterials; i++) { Material = tempMaterials.MatD3D; Material.Ambient = Material.Diffuse; } return; } void RenderFrame() { d3ddev->Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), 1.0f, 0 ); d3ddev->Clear( 0, NULL, D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0 ); D3DXMATRIX matProjection; D3DXMatrixPerspectiveFovLH(&matProjection, D3DXToRadian(45.0f), (float)SCREEN_WIDTH / (float)SCREEN_HEIGHT, 0.1f, 300.0f); d3ddev->SetTransform(D3DTS_PROJECTION, &matProjection); D3DXMatrixIdentity(&matProjection); D3DXMATRIX matView; D3DXMatrixLookAtLH(&matView, &D3DXVECTOR3(Camera.Pos.x, Camera.Pos.y, Camera.Pos.z), &D3DXVECTOR3(Camera.Angle.x, Camera.Angle.y, Camera.Angle.z), &D3DXVECTOR3(Camera.UP.x, Camera.UP.y, Camera.UP.z)); d3ddev->SetTransform(D3DTS_VIEW, &matView); d3ddev->BeginScene(); D3DXMATRIX matWorld; D3DXMatrixTranslation(&matWorld, Pyramid.mPos.x, Pyramid.mPos.y, Pyramid.mPos.z); d3ddev->SetTransform(D3DTS_WORLD,&matWorld ); for(DWORD i = 0; i < numMaterials; i++) { d3ddev->SetMaterial(&Material); meshObject->DrawSubset(i); } D3DXMATRIX matGrid; D3DXMatrixTranslation(&matGrid, 0.0f,0.0f,0.0f); d3ddev->SetTransform(D3DTS_WORLD,&matGrid ); DrawGrid(); d3ddev->EndScene(); d3ddev->Present(NULL, NULL, NULL, NULL); return; } void CleanD3D() { d3d->Release(); d3ddev->Release(); meshObject->Release(); } void InitLight() { D3DLIGHT9 light; ZeroMemory(&light, sizeof(light)); light.Type = D3DLIGHT_DIRECTIONAL; light.Diffuse.r = 0.5f; light.Diffuse.g = 0.5f; light.Diffuse.b = 0.5f; light.Diffuse.a = 1.0f; D3DVECTOR vecDirection = {-1.0f, -1.0f, -1.0f}; light.Direction = vecDirection; d3ddev->SetLight(0, &light); d3ddev->LightEnable(0, TRUE); return; } [Edited by - ShurikeN on March 18, 2008 6:25:32 PM]
10. ## SDL isometric view

is it possible with SDL?
11. ## compile Errrrrror

im using DevC++ along with DirectX 9.0c Devpak http://www.g-productions.net/page.php?id=23 and im trying to compile this tutorial http://www.riemers.net/eng/Tutorials/DirectX/C++/Series1/tut3.php but i get an error -"[Link error] undefined reference to 'Direct3DCreate9@4'"- what seems to be the problem here?
12. ## this is my first time question here

isn't there any other way to learn DirectX without learning Win32 API?