# DefCom

Member

189

270 Neutral

• Rank
Member
1. ## C++, Graphics, Game Programming, Where do I start?

Hi, Possibly/Probably an outdated method, but i started by just creating a win32 project and just used the GDI. Not a great method for creating games, but I learned a lot about programming before i moved onto DirectX.   Worth pointing out this was around 14 years ago, but i did use the GDI methods to teach some basic 3D programming just a few years ago.
2. ## so many thing to learn! where do i start?!

That's a bit scary, thanks i'll go and check that out
3. ## so many thing to learn! where do i start?!

Hi, If it helps i have started uploading game programming tutorials (c# and XNA) (written and video) aimed at beginners. They were written for my extra curricular ICT club. [url="http://www.defcom1.net"]www.defcom1.net[/url] and [url="http://www.youtube.com/gamexero"]youtube[/url]
4. ## Free Beginner Game Programming Lessons

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. [url="http://www.defcom1.net"]DefCom1.net[/url] I am also going to be offering online videos to support the course. Thanks for looking
5. ## Camera following airplane

yeah, this isnt really my strong point, but i have spent the past 3 weeks over this aspect of my game. I have yaw, pitch and roll, which are converted to the plane rotation quaternion. I then have a camera quaternion which is generated by the above function. The return is the new camera quat' It took me such a long time to do and get working i plan to try and write it up for others to use. I am currently trying to get a propellor to spin on it's axis and rotate around the plane... it's proving tricky.
6. ## Camera following airplane

Hi, I have just done this today. I have used quaternions to perform the rotation and the Lerp (linear interpolation) to move the camera. My code is a bit messy at the mo' it takes the quat of the camera and plane along with a float that delays it a bit. I used reimmers xna flight sim tutorial and googles quaternion lerp c++ This is my mixture of the above Quaternion NLerp(Quaternion tQ1, Quaternion tQ2, float w2) { float w1 = 1.0f - w2; Quaternion tQ3; tQ1.w*=w1; tQ1.x*=w1; tQ1.y*=w1; tQ1.z*=w1; tQ2.w*=w2; tQ2.x*=w2; tQ2.y*=w2; tQ2.z*=w2; tQ3.w=tQ1.w + tQ2.w; tQ3.x=tQ1.x + tQ2.x; tQ3.y=tQ1.y + tQ2.y; tQ3.z=tQ1.z + tQ2.z; //normalise float TOLERANCE = 0.00001f; // Don't normalize if we don't have to float mag2 = tQ3.w * tQ3.w + tQ3.x * tQ3.x + tQ3.y * tQ3.y + tQ3.z * tQ3.z; if ( mag2!=0.f && (fabs(mag2 - 1.0f) > TOLERANCE)) { float mag = sqrt(mag2); tQ3.w /= mag; tQ3.x /= mag; tQ3.y /= mag; tQ3.z /= mag; } return tQ3; }
7. ## rotoscoping using 3d software

Hi, This may be a bit random but... The original Prince of persia (before flash back) was based on the programmers younger brother. He filmed him running and jumping then redrew the frames. I ripped off this idea using Deluxe Paint on the Amiga, but could so easily be done using photoshop or gimp. Since then I have used Poser for creating animated models and then rendered them to a bitmap and then... copied each image in a sprite sheet. I have also used blender and truespace to achieve similar results for vehicles.
8. ## Object Rotation - Yaw, Pitch and Roll - Help

Finally Managed it. Thanks for all your help :)
9. ## Object Rotation - Yaw, Pitch and Roll - Help

Thanks for the help so far. After much reading and tinkering i have the rotation working as desired, but now... i do not know how to move in the correct direction :( so story so far... Quaternion tQ1, tQ2, tQ3; Quaternion rotChange; tQ1.CreateFromAxisAngle(1,0,0, pitch); //pitch (i think....) tQ2.CreateFromAxisAngle(0,1,0, yaw); //roll tQ3.CreateFromAxisAngle(0,0,1, -roll); //yaw rotChange= tQ1 * tQ2 * tQ3; planeRot = rotChange * planeRot; //covert my matrix to d3dxmatrix createD3DXMATRIX(matWorld, planeRot); aeroplane.setMatLocal(matWorld); Up until now all my 3d projects have usually moved in 2d only. Again any help pointing me in the right direction of how to get my object moving would be much appeciated. I have tried this based on a few articles and forums. Quaternion addVector, invVector; addVector.x=-1; addVector.y=0; addVector.z=0; addVector.w=0; invVector.x=-planeRot.x; invVector.y=-planeRot.y; invVector.z=-planeRot.z; invVector.w=0; addVector=planeRot * addVector * invVector; aeroplane.vLoc.x+=addVector.x; aeroplane.vLoc.y+=addVector.y; aeroplane.vLoc.z+=addVector.z; Which does move the object, but not as desired.
10. ## Object Rotation - Yaw, Pitch and Roll - Help

Hi, Thanks again for the reply. I am not too bothered about yaw at this time, the game is to be controlled by a single stick. I have spent the past couple of days reading and experimenting, still no further. I have a cerated a simple 3d enviroment using only Win32 GDI in the hope i can fully grasp what is going on without code being hidden in DirectX functions and data structures. ermm.. what's reorthonormalize? And i don't know how to rotate the other vectors accordingly. I can rotate objects all dimension, just do not know how to take into account that the local Y axis is now different to the World Y axis. Thans again.
11. ## Object Rotation - Yaw, Pitch and Roll - Help

Hi, Thanks for the response. I have researched the 6 DOF. Everything i come across discuses this in the context of the camera and the view matrix. I have applied many methods pinched off the net and I have tried simple switching the order of matrix multiplication. I want to be able to turn the user input pitch and roll and have it control the object, as you would in a RC model plane simulator. For the sake of keeping it simple, the camera will remain static. If I am right in saying I want the roll to change the 'up' vector (?) And the pitch would change 'right' (?) I don't actually know how to transform them ... Am I going about this all wrong? Any further help would be greatly appreciated , thank you
12. ## Object Rotation - Yaw, Pitch and Roll - Help

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.
13. ## VS2008 Windows Form Application & Directx

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
14. ## Moving camera and moving object problems

Thanks. I have changed that bit code too now. :)
15. ## Moving camera and moving object problems

:) Thank you. I moved the render bike call to after View and before projection and it seems to have solved it. I wonder why i never noticed this before??? Thanks again