• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About snoddas14

  • Rank
  1. Direct3D9 - Vertex dosent give color.

    OH LOLLYPOP what LOLZ! had set that the it would return true when it had created the entier VertexBuffer, and it had ignord half of my code ;) so its working now! and thx for the tips of rendering all insted at one at the time! it had never crosed my head ;) cheers!
  2. Direct3D9 - Vertex dosent give color.

    Tested, Nothing workt. and i dont use a texture for it, so i dont think i need to change the textureStage. but if you prove it´s 100% that i fix it. any other Clue?
  3. Direct3D9 - Vertex dosent give color.

    Yes i dont know why i have set it to 0,0,0 under the exampel, but i have tested in at 255,255,255 255,0,0 0,255,0 0,0,255 and all kind of stuff! and it still gets black!
  4. o/ i am trying to make a standard GREEN grid, but it is driving me crazy on the color! i just wont work. the only problem is that it is ALLWAYS BLACK! here comes the code. [sourcecode] //the looping. dont bother how it loops them out! //only get the color working :P for(int x = 0; x<500; x+= 2) { grid[x].X = (float)x; grid[x].Y = 0.0f; grid[x].Z = 600.0f; grid[x].Normal = D3DXVECTOR3(0.0f,1.0f,0.0f); grid[x].Color = D3DCOLOR_ARGB(0,0,0,0); } for(int z = 1; z<500; z+= 2) { grid[z].X = (float)z-1; grid[z].Y = 0.0f; grid[z].Z = -100.0f; grid[z].Normal = D3DXVECTOR3(0.0f,1.0f,0.0f); grid[z].Color = D3DCOLOR_ARGB(0,0,0,0); } for(int z = 501; z<1000; z+= 2) { grid[z].X = 600.0f; grid[z].Y = 0.0f; grid[z].Z = (float)z-501; grid[z].Normal = D3DXVECTOR3(0.0f,1.0f,0.0f); grid[z].Color = D3DCOLOR_ARGB(0,0,0,0); } for(int x = 500; x<1000; x+= 2) { grid[x].X = -100.0f; grid[x].Y = 0.0f; grid[x].Z = (float)x-500; grid[x].Normal = D3DXVECTOR3(0.0f,1.0f,0.0f); grid[x].Color = D3DCOLOR_ARGB(0,0,0,0); } //vertexbuffer creation! gDev->CreateVertexBuffer(sizeof(grid)*sizeof(VERTEX), 0, CUSTOMFVF, D3DPOOL_MANAGED, &vbDev, NULL); VOID* pVoid; vbDev->Lock(0,0,(VOID**)&pVoid,0); memcpy(pVoid,grid,sizeof(grid)); vbDev->Unlock(); //and the rendering! gDev->Clear(0,NULL,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,D3DCOLOR_ARGB(0,(int)renderRGB[0],(int)renderRGB[1],(int)renderRGB[2]),1.0f,0); gDev->BeginScene(); gDev->SetFVF(CUSTOMFVF); gDev->SetStreamSource(0,vbDev,0,sizeof(VERTEX)); for(int i = 0; i<=sizeof(grid); i+=2) { gDev->DrawPrimitive(D3DPT_LINELIST,i,1); } [/sourcecode]
  5. Hi! im trying to set the LoD of a Mesh. it dosent work and i dont get anny debug Msg. here is the code. and i want answers on what i have done wrong and how to solve it. not just "sett the parameter to five" or somthine like that. i want more like "D3DXLoadMeshFromX(...,*Sett the g_Buffer here*,...); and that is becus of the *Reason* ht = D3DXTessellateNPatches(ppMesh, (DWORD*)Buf->GetBufferPointer(), (float)Segments,FALSE,&ppMesh,NULL); if(ht == D3DERR_INVALIDCALL) { MessageBox(NULL,"a01","Error",MB_OK|MB_ICONERROR); } else if(ht == D3DXERR_INVALIDDATA) { MessageBox(NULL,"a02","Error",MB_OK|MB_ICONERROR); } else if(ht == E_OUTOFMEMORY) { MessageBox(NULL,"a03","Error",MB_OK|MB_ICONERROR); } else if(FAILED(ht)) { MessageBox(NULL,"Failed","Error",MB_OK|MB_ICONERROR); } // Mesh code D3DXLoadMeshFromX(fileName, D3DXMESH_SYSTEMMEM, vDev, NULL, &BufferMaterial, NULL, &NumMaterial, &ppMesh) Many Thanks and Pleas tell me if you dont understand.
  6. hello! is there anny commando that collect all the vertex information ( XYZ ) and then able to change them and save them again.
  7. hey! i just wonder if i could do one thing on my computer and transfer it to my Xbox 360. and run it on my 360. i know XNA could do this but i want to do it whit D3D9, becus i want to create my own engine. if it is posible, could any one send som tutorials on how to use the X360 hand controller! cheers!
  8. hey. when i load my vertexbuffer whit one texture and lets say we load the "blue.jpg" picture and then i create a new class and do a new commando for the vertexbuffer initalation and then i set it whit the "red.jpg" picutre. both of them will get the Red picture or the last one wrote on the command. in my vertex class i have set the LPDIRECT3DVERTEXBUFFER9 Device under Private. and the LPDIRECT3DTEXTURE9 under protected. and still it aint working. help is needed.
  9. hi ppl. i´m trying to just do a simple 2d moveTo command. so this is the Math i use so far. X = X1 - X2; Y = Y1 - Y2; X_Pos += X; Y_Pos += Y; and i can get 2 results. 1: the pixel just jumps to the EXAKT kordinats of my B point. just from A to B. and well thats what i want but i actualy want it to move not just jump. 2: it moves in the wrong direction and it actualy Moves but its going fast as hell. and im using C++ // if my description is bad tell me.
  10. hello! duno if this is the right forum to ask this whit but i gona give it a try. it aint world politics. first of all im trying to build my own Bounding box function. the whole code of it is beeing this at the moment : if(obj1.x > obj2.x && obj1.x < obj2.x + obj2.w) { //Colission. } if(obj1.y > obj2.y && obj1.y < obj2.y + obj2.h) { //Collission. } the thing is thes code dose not work ( only tryd it in flash but the math if shuld still be the same and the princip.) another question. is there som built in function for colission? i think its calld a Ray or somthing, but as i said am asking buckus i dont know! so if any one konw if there is such a function pleas inklude a link of a tutorial or a tutorial source kode. or just the funtion whit komments. cheers!
  11. i solved it but in a prity lame way! just added the (LPDIRECT3DDEVICE9 gDev) to a parameter :P but if ther aint lame ways ther wont be good ways. some one has to do it.
  12. well could you give me an exaple code whit some komments?
  13. oh sorry. well i want a return function to my allredy created device. becus i get break errors on all those other functions who need my device. at the moment i am using som thing like this to give my device to other functions. class DirectX { private: LPDIRET3D9 pDev; public: LPDIRECT3DDEVICE gDev; }; // of course whit more functions and so. DirectX Device; Device.gDev->Clear(....); and it is on my command Clear i get the break error in MSVS 2003.net if you still dont get what i mean i gona try to explain in a diffrent way
  14. hello. i got the issu that when i creat a class the DirectX class whit the LPDIRECT3DDEVICE9 gDev; device. i want to make a funtion that i can use inside other klasses example that i creat a funtion thats return the pointer. i read som where online that i could do it like inline LIDPIRECT3DDEVICE9 ReturnDeviceName(); but serisuly that dosent work for me either. so if some one know how i could do this and want to send me a Example code or tutorial on how to do it. i would be glad. if my explanation is bad pleas tell me.
  15. oh okey. i got only a sizeof there. and the sizeof(VERTEXSTRUCT)
  • Advertisement