Muzzy A

Member

197

737 Good

• Rank
Member

2. Basic Speed, Velocity and Acceleration. Am I doing it right?

It looks like speed should be called Force.  You're applying it to the acceleration which means it's a sort of force. Velocity already contains your speed. Just a little note.
3. Adding a scrolling camera stuck with the maths

You can just add or subtract the camera's position   an object is at position // Screen Coordinates x = 300; y = 300; The camera's top left is at position x = 200 y = 200 Picturing this in your head you can tell it should render at 100,100 on the screen   soooooo objX - camX = 100; objY - camY = 100; For input.... You clicked the screen at position x = 100; y = 200; Cameras top left position x = 200; y = 200;   // Coordinates in the world would then be... x = mouseX + camX; // 300 y = mouseY + camY; // 400   gridPos = worldIsoGrid( x,y,widthHalf,heightHalf);
4. C# 2D Body Animation help

I was searching and didn't realize there aren't many free articles on this subject.   A Book:  3D Animation     You'll want a class like this class KeyFrame {     Vector2 Position;     float Scale;     float Rotation;     float StartTime; };   // Store all of your key frames into a list List< KeyFrame > frames;   // To create the key frames, I suggest making a button to push to set the key frame // You will have to set the time in which each frame starts // first frame starts at 0 seconds, second frame may start at .5 seconds, the 3rd one at .65 seconds, 4th at 1 second... etc   // or you can set it up so that you can just set the very last key frame to the length of the animation and average out the rest of the key frames times from that   // Actually playing this animation you will have to store the total time elapsed in this animation, along with the current index.   class Animation {     float fTimeElapsed;     int CurrentIndex;     List< KeyFrame > frames; };     // You'll want to interpolate between frames to get that smooth looking animation
5. Programming a Level Editor

Having a level editor will make the creation of your levels go MUCH faster.  It will save you a lot of time to go out of the way to create the editor.  Making a 2D editor should take you no time at all. ( Assuming you're using C# Windows Forms for it )
6. What to do after the basics

There used to be an awesome guide to creating a text RPG called wrath lands that I was going to post here.  It brought everything in perspective of how you can use C++ for game programming for me.  But unfortunately it isn't there anymore :(   As it's already been said before create some simple little things.   A guessing game where you guess a number between 1-100, have a difficulty setting, easy you get 7 tries, medium you get 5 tries, hard you get 3 tries.   Try to create a text RPG, you don't have to make the full game.  But get it so that you have a battle system that works, and you can travel from town to town. Level up you skills.   Just search google for ideas to apply your skills to and learn.   Even to this date I still go to Project Euler to challenge myself.  It has a ton of logic problems and math problems to solve by programming.  And they're made so that you can't just come up with the answer in your head.
7. Camera distortion using Directx Math

XMMatrixLookAtLH()   The second parameter is the "Focus Position" not the direction.  So for that parameter you might want to add the direction vector to the position vector. // This would be the correct way to do it XMMatrixLookAt(  eyePosition, eyePosition + direction, upDirection );     EDIT: I just realized you used "LookTo" not "LookAt". so my post probably isn't helpful.   is your forward vector valid when you get to the look at function?
8. Ray/AABB Intersection Incorrect

Learn a little about AABB to Ray intersect instead of just copying the code.  It's not that difficult if you know vector math.  But there are other guides to help you.   Another topic about AABB to Line Segment ( has Ray to AABB code ) Video Explaining Ray to AABB ( No code, just the math side ) A little guide to creating Ray to AABB Checks ( Has code, gives a little bit of explanation for it too )   EDIT: After you complete that, I would look into using OBB's instead of AABB's if your cube is going to be changing orientation.

PROBLEM SOLVED   My graphics card doesn't support version 3.0 pixel shaders, had to use version 2.0.  I was looking up reasons why ID3DXEffect::ValidateTechnique() would fail and found a topic on here that led me to test the version I'm using.  3.0 works with the vertex shader however... I guess I better put it down to 2.0 just to be safe, just have to be careful with how many calculations I perform.   Before I made this topic I thought about changing those down to 2.0 to see if it worked... I should have done it, but I assumed this computer was new enough to be aware of version 3.0, assumptions can cause problems.  Lesson learned.

Please don't be condescending, I'm trying to get help.  I never post all of my code at once, I try to keep the problem as simple as I possibly can so I can get as much help as possible.  Nobody likes to look at a HUGE wall of code to help with what might simply be a typo when rendering or making the shader =).   PIX hasn't been working well for me,  whether I have the Direct X debugging tools turned on or not.  It becomes an annoyance to mess with and get it to work correctly, which is why I've gotten lazy with using PIX lately. I'm trying again though, will reply with my result.