• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Daedric

  • Rank
  1. thanks guys i understand these replies are great!
  2. Ive been working natively in C through college and getting into real world applications a friend brought the question onto me of, when in game programming, or any instance for that matter, is it better to use C than C++? I do know that C++ has a vast STL that makes it nicer to code in. But the only thing i can come up with is that sometimes... (lightly) hand-written code in C may perform faster than something written in alot less lines of code in C++. I dont mean for this to be a C++ vs. C flame just looking for a couple examples. Thanks! daedric
  3. wow silly me, thank you sir
  4. ok so i have a project and usually i have been just been puting .bmps in the local folder, lets say MyProj\test.bmp, so when i call my D3DXCreateTextureFromFile i just call with "test.bmp" well im currently testing a project that includes multiple bmp images so i would like to put them into further folders in the project folder, lets say MyProj\Bitmaps\test.bmp. my assumption was to call it using the Source file string as ".\Bitmaps\test.bmp", but nothing shows up? i am using visual studio 2005 daedric
  5. camera position question

    so how would i accomplish having the view be directly down on the plane? im trying to simulate 2d in 3d. How would i calculate the up vector?
  6. camera position question

    if i define my camera as the following my plane dissapears D3DXMATRIX matView; // the view transform matrix D3DXMatrixLookAtLH(&matView, &D3DXVECTOR3 (16.0f, 40.0f, 16.0f), // the camera position &D3DXVECTOR3 (16.0f, 0.0f, 16.0f), // the look-at position &D3DXVECTOR3 (0.0f, 1.0f, 0.0f)); // the up direction d3ddev->SetTransform(D3DTS_VIEW, &matView); // set the view transform i figured out it only dissapears when my camera and look at position have the same x and z coordinates. all i have is one quad located at 16, 0, 16 to 17, 0, 17. if i change the camera to the following my quad appears again? D3DXMATRIX matView; // the view transform matrix D3DXMatrixLookAtLH(&matView, &D3DXVECTOR3 (16.0f, 40.0f, 16.1f), // the camera position &D3DXVECTOR3 (16.0f, 0.0f, 16.0f), // the look-at position &D3DXVECTOR3 (0.0f, 1.0f, 0.0f)); // the up direction d3ddev->SetTransform(D3DTS_VIEW, &matView); // set the view transform these are my render states d3ddev->SetRenderState(D3DRS_LIGHTING, TRUE); // turn on the 3D lighting d3ddev->SetRenderState(D3DRS_ZENABLE, TRUE); // turn on the z-buffer d3ddev->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_XRGB(100, 100, 100)); // ambient light d3ddev->SetRenderState(D3DRS_NORMALIZENORMALS, TRUE); // handle normals in scaling
  7. I have created a plane of textured quads laying on the x and z axis. My issue occurs when i place the camera at (16.0f, 10.0f, 16.0f). The plane of textures is located at 0.0f on the y-axis. How come when i put the camera at the perpendicular angle (to look straight the plane) the plane of textures dissapears, but if i change the camera to something just off like (16.0f, 10.0f, 16.1f). also, the block of textures is 32x32 so 16 and 16 is the center, and my look at position is (16.0f, 0.0f, 16.0f). i can see it. any ideas? Thanks in advance!
  8. issues with drawing primitive

    ok i fixed my problem, i changed the while loop to for loops that work off of ints instead of the float values, and reset iposx and the x counter every time the z decrements. Thanks for your time. daedric
  9. issues with drawing primitive

    i believe my vertices are in correct order, when i draw just one single one with the same vertices it will draw the two triangle (one square)
  10. ok so im attempting to use a vertex buffer and the draw primitive funtion to create a simple square plane the has a texture repeating in it. I know this can be done easily by drawing one large 4 vertice triangle strip and set it to repeat the texture. but what if i wanted to draw each texture block seperately? when i try this nothing shows up? I have a loop set to create 1.0f x 1.0f blocks in a square, so right now i increase a counter and then translate to the counter and call draw primitive again. any thoughts? here is what i am attempting.. static float iposx = 32.0f; static float iposz = 32.0f; while(iposz >= 0.0f) { while(iposx >= 0.0f) { D3DXMatrixTranslation(&matTranslate, iposx, 0.0f, iposz); d3ddev->SetTransform(D3DTS_WORLD, &(matTranslate)); // set the world transform // set the texture d3ddev->SetTexture(0, texture_1); // draw the textured cube d3ddev->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); iposx -= 1.0f; } iposz -= 1.0f; } the field is on the x and z axis so the camera is up the y axis looking down on it. and my vertices are defined as this... CUSTOMVERTEX t_vert[] = { // floor { 32.0f, 0.0f, 0.0f, 0, 1, 0, 1, 0, }, { 0.0f, 0.0f, 0.0f, 0, 1, 0, 0, 0, }, { 32.0f, 0.0f, 32.0f, 0, 1, 0, 1, 1, }, { 0.0f, 0.0f, 32.0f, 0, 1, 0, 0, 1, }, };
  11. A c question

    sweet thanks guys
  12. A c question

    it will be in a windows (xp) environment, sorry forgot to specify this
  13. A c question

    Hey i have a project to figure out thats fairly simple and im stuck on a simple question that i'm having trouble searching for a solution. All my code needs to do is go through a tab delimited text file and remove lines that include "Event". This I CAN DO. The problem arises because i want the code to open a file browser to allow the user to open any file they choose to remove these lines from. Is there a simple function to open the file browser in c or c++? thankyou in advance for any help received. Daedric
  14. where to start? (no really =0 )

    my problem with looking at source code is its all seperated up, like in the quake 1 example, where do i start? sure i can open random files but is there a best way to go about looking at samples? like i just wish there was design documents for the 100 .c files :( . BTW, it seems everyone recomends c++, but most i see is in .c files, same difference? yes i know c isnt c++ just asking
  15. where to start? (no really =0 )

    hmm, that really does give some good insight to openGL, and i might look more into that path if i can't find something similar in DirectX. I have heard openGL is easier, but positions id like to get into would be more towards DirectX. those two websites do look like a start that could lead to better things though thank you! i would also like to see what others recommend, if theres more websites like that it seems i will be busy! ;) Daedric
  • Advertisement