Jump to content

  • Log In with Google      Sign In   
  • Create Account

DefCom

Member Since 30 May 2001
Offline Last Active Jan 02 2014 01:48 AM

Topics I've Started

Free Beginner Game Programming Lessons

04 December 2011 - 01:34 PM

Hi,

I am a teacher of ICT and Computing and I deliver an extra curricular game programming club.
I have decided to put my lessons online for anyone who wants to use them.

The first batch of lessons focus on a simple 2D game using c# and XNA, but will go on to cover 3d gaming,
The lessons assume no prior knowledge of programming or game development.

DefCom1.net

I am also going to be offering online videos to support the course.
Thanks for looking

Object Rotation - Yaw, Pitch and Roll - Help

23 October 2010 - 11:49 PM

First, many apologies for asking a question that seems to have been asked many times, but after days of searching and expermenting i do not seem to be getting anywhere.

I am like many trying to create aeroplane style rotation. The ability to bank(roll) and then change the pitch of the craft, using the new Y axis which of course is no longer straight up

My original code is as follows

D3DXMatrixScaling(&matScale, bike.vScl.x, bike.vScl.y, bike.vScl.z);
D3DXMatrixTranslation(&matWorld, bike.vLoc.x, bike.vLoc.y, bike.vLoc.z);
D3DXMatrixRotationX( &matRotateX, bike.vR.x );
D3DXMatrixRotationY( &matRotateY, bike.vR.y );
D3DXMatrixRotationZ( &matRotateZ, bike.vR.z );
D3DXMatrixMultiply( &matWorld, &matWorld, &matScale);
D3DXMatrixMultiply( &matTemp, &matRotateX, &matRotateY );
D3DXMatrixMultiply( &matTemp, &matRotateZ, &matTemp );
D3DXMatrixMultiply( &matWorld, &matTemp, &matWorld );
bike.setMatLocal(matWorld);



I have tried quite a few things, but many resources seem to focus on the 'camera'
i assume(hoping) i could just tranform the Y axis and it would all work quite happily.

If anybody could point me in the right direction (no pun intended) it would be appreciated.
Thanks.

VS2008 Windows Form Application & Directx

19 June 2010 - 09:33 PM

Hi all,

I am having a huge problem trying to get a Visual Studio 2008 Windows Form Application & Directx set up.

I have spent about 4 hours experimenting and searching the web, does anybody know of any tutorials?

I (think i)know how to get the handle to a component, but do not know how to include all directx file?

I am brand new to this aspect of visual studio ( i have lots of experiance of traditional C++, win32 and vb.net

Any help would be appreciated

Thanks



Moving camera and moving object problems

21 April 2010 - 04:04 AM

Hi all, After a 7 year gap I am back on 3d programming and I have run into a problem i can't seem to solve. I am making a bike game. If i move just the bike everything is smooth. If i move just the camera everything is smooth. If i move the bike and have the camera follow or the bike judders/displaces, the terrain and other static objects are still smooth. I am using Directx 9 and visual studio 2008 on Windows 7. In an attempt to identify the cause of the problem i have removed much of the code dealing with movement and left myself with code that simply moves the bike to the right, the camera matches the location of the bike, but 10 units back. When not moving the bike it is perfectly central, but when i move the bike (pressing right arrow) it jumps to the right of the screen and when i release the key it returns to the center. My code is almost identical to what i used to do in directx 8 and i never had any problems.
void drawFrame()
{

	//Time based movement
	lastTime=currTime;
	currTime=GetTickCount()*0.001f;
	timeElapsed=currTime-lastTime;



//temp bike control
	if(KEYDOWN(VK_UP))
	{
		bike.vLoc.x++;
	}

	D3DXMATRIX matWorld, matScale, matTrans;	
	D3DXMATRIX matTemp, matRotateX, matRotateY, matRotateZ;

	D3DXMATRIX matLocal;

	vLook.x=bike.vLoc.x;
	vLook.y=bike.vLoc.y;
	vLook.z=bike.vLoc.z;
	
//match position + 10 units
	vCam.x = bike.vLoc.x;
	vCam.y = bike.vLoc.y;
	vCam.z = bike.vLoc.z-10;


	D3DXMatrixScaling(&matScale, bike.vScl.x, bike.vScl.y, bike.vScl.z);
	D3DXMatrixTranslation(&matWorld, bike.vLoc.x, bike.vLoc.y, bike.vLoc.z);
	D3DXMatrixRotationY( &matRotateY, -bike.vR.x );
	D3DXMatrixRotationX( &matRotateX, -bike.vR.y );
	D3DXMatrixRotationZ( &matRotateZ, -bike.vR.z );
	D3DXMatrixMultiply( &matWorld, &matWorld, &matScale);
	D3DXMatrixMultiply( &matTemp, &matRotateX, &matRotateY );
	D3DXMatrixMultiply( &matTemp, &matRotateZ, &matTemp );
	D3DXMatrixMultiply( &matWorld, &matTemp, &matWorld ); 
	bike.setMatLocal(matWorld);
	bike.render(g_pd3dDevice);	

	D3DXMatrixScaling(&matScale, checkPoint.vScl.x, checkPoint.vScl.y, checkPoint.vScl.z);
	D3DXMatrixTranslation(&matWorld, checkPoint.vLoc.x, checkPoint.vLoc.y, checkPoint.vLoc.z);
	D3DXMatrixRotationY( &matRotateY, -checkPoint.vR.x );
	D3DXMatrixRotationX( &matRotateX, -checkPoint.vR.y );
	D3DXMatrixRotationZ( &matRotateZ, -checkPoint.vR.z );
	D3DXMatrixMultiply( &matWorld, &matWorld, &matScale);
	D3DXMatrixMultiply( &matTemp, &matRotateX, &matRotateY );
	D3DXMatrixMultiply( &matTemp, &matRotateZ, &matTemp );
	D3DXMatrixMultiply( &matWorld, &matTemp, &matWorld ); 
	checkPoint.setMatLocal(matWorld);

	checkPoint.render(g_pd3dDevice);	





	/*View */

	D3DXMATRIX matView;
    D3DXMatrixLookAtLH( &matView, &D3DXVECTOR3( vCam.x, vCam.y, vCam.z), 
                                  &D3DXVECTOR3( vLook.x, vLook.y, vLook.z ), 
                                  &D3DXVECTOR3( 0.0f, 1.0f, 0.0f ) );
    g_pd3dDevice->SetTransform( D3DTS_VIEW, &matView );

	//Projection
    D3DXMATRIX matProj;
    D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 100000.0f );
    g_pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );





I am really hoping someone can spot something i have overlooked. Any help will be much appreciated, thank you

YaBasic Help please

10 March 2006 - 08:23 PM

Hi, I am an ICT teacher and some Y7s have asked me to teach them about games programming. Long story short, we are using win32 ps2 yabasic. I can't seem to get the keyboard input working properly.
repeat
	press$ = INKEY$
        //doing pong game here

UNTIL (press$ = "q")


but the screen is only updating when i press a key. I have spent ages on google and experimenting, but no success. We don't access to controllers. Any help would be greatly appreciated Thanks. [Edited by - DefCom on March 11, 2006 3:05:34 AM]

PARTNERS