xboxscene.org forums

Author Topic: D3d And Xbox Tutorials  (Read 36 times)

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
D3d And Xbox Tutorials
« on: January 23, 2003, 08:20:00 AM »

Well, you can meander over to GameDev.net and check out their many articles and tutorials.

There is another thread here where I posted a link to a web site with a few Xbox tutorials.

DX8 is the same on the Xbox, but with less hassle for handling the GUI issues or worrying about cooperating with other applications.

There is a framework, of sorts, and it includes a lot of nice hepers for input, sound and graphical elements.
Logged

DevSpook

  • Archived User
  • Newbie
  • *
  • Posts: 31
D3d And Xbox Tutorials
« Reply #1 on: January 23, 2003, 11:03:00 AM »

QUOTE
i hate to be a code pasting crack monkey, but i cant seem to figure out why this refuses to work...its according to all teh guides, tutorials, and examples i have found..  sorry for bein stupid...


There isn't really enough information in the code sample to decide if it works or not. Other things you need to take into consideration:

- Where is the camera placed, and what is it looking at
- What are the settings for the far/near plane (D3DXMatrixPerspectiveFovLH)
- Is the face in your vertex buffer pointing away from you or towards you
- What is the scale of the object in your vertex buffer

In general, the code you pasted looks ok, but you need to make sure the things I mentinoed above are also correct.

Oh, and if this is your first dabble in D3D, I would lose the vertexshader. The simpler the better. smile.gif
Logged

sicman

  • Archived User
  • Newbie
  • *
  • Posts: 11
D3d And Xbox Tutorials
« Reply #2 on: January 23, 2003, 11:32:00 AM »

smile.gif anyways, this is what i setup D3D to do
   // Turn off culling
   g_pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );

   // Turn off D3D lighting
   g_pd3dDevice->SetRenderState( D3DRS_LIGHTING, FALSE );

   // Turn on the zbuffer
   g_pd3dDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
since taht came out of the tuts, then i set up the camera (i guess) with this:
   D3DXMATRIX Ortho2D;   
   D3DXMATRIX Identity;
   
   D3DXMatrixOrthoLH(&Ortho2D, SCREEN_SIZE_X, SCREEN_SIZE_Y, 0.0f, 1.0f);
   D3DXMatrixIdentity(&Identity);

   g_pd3dDevice->SetTransform(D3DTS_PROJECTION, &Ortho2D);
   g_pd3dDevice->SetTransform(D3DTS_WORLD, &Identity);
   g_pd3dDevice->SetTransform(D3DTS_VIEW, &Identity);

thats all out fo the tutorial, and im not to sure what ALL of it does...but i was under the impression that since, when i rean the program, the graphics i loaded were displayed and i could move them around the screen (not using matrix transformations, but by adding to the verteices) that the camera was facing towards my objects.  SO basicly, i have 2 object: i have one i display by manually movign the points in the verticies, and i have the one im trying to move with the matrices. The one i try to move, m_pVB, doesnt move, but it does display on the screen. i have tried several different ways to try to make it move, but no luck. Do matrix transformations and rotatiosn work on only 2 triangled figures?


well as an update, i compiled M$ matrix code, taht makes a Triangle rotate...i copied, pasted EXACTLY as is into my code...and it faisl to work...the object still refuses to move. .. sad.gif im sad. sad.gif <--frowny face.
Logged

dankydoo

  • Archived User
  • Full Member
  • *
  • Posts: 145
D3d And Xbox Tutorials
« Reply #3 on: January 23, 2003, 12:57:00 PM »

I would suggest for x, y screen coordinates that you just use the D3DFVF_XYZRWH so that you can use untransformed x,y screen coordinate verticies, it'll make life easier, unless there is something specific you are looking for ......


dankydoo
Logged