Jump to content

  • Log In with Google      Sign In   
  • Create Account

Motoky

Member Since 18 Sep 2012
Offline Last Active Nov 19 2014 04:47 AM

Topics I've Started

3D Line Equation?

14 August 2014 - 05:03 AM

I am currently learning from a book called Beginning Maths and Physics for Game Programmers. I had trouble with this book quite early on due to the fact that I had completely forgotten most of the maths I had learnt at school so I went through some Algebra and Linear Algebra books to help me and I feel I am doing better with this book, this time around.

 

Now, I am confused about a question in the book. It says, "Find the equation of a line connecting the following pairs of points:"

 

It continues to list a few points for a 2D coordinate system, but the last two is a 3D coordinate system and the two points for one of the questions are:

 

(2, 0, -1) and (3, 4, 5)

 

Now, the book doesn't tell you at all how to find out how to get the equation of three points, only two. I have tried applying different ways of doing it, but it never turns out right. I would have thought, when you come to exercises or tasks, you should be at least taught how to do it and not thrown into the dark because you learnt how to do the bare minimum.


Books & Libraries

21 July 2014 - 04:01 AM

I've been through one book fully of C++, I didn't find it to be very helpful for a beginner at the time, I was very confused with a lot of the material, kind of set me back a bit, especially containers, file I/O, etc. On my second book, relearning stuff that I was confused about and little bits of information that I never knew before. I feel I've become better at C++ even though I've only been doing it for a few years.

 

Anyway, I'm mainly wanting to work on games, but it's always good to learn about other stuff besides games and how they work. Now, networking is something I've not delved into yet, it's always been in the back of my mind and when I should learn a bit about it.

 

I was just wondering which books you would recommend learning from about network programming, networking in general and maybe a good library for C++ to use. I've just thought about working on an Instant Messenger program and wouldn't even know where to start.


How does resolution work?

30 June 2014 - 06:22 AM

I've always wondered, when developing a game, there are obviously going to be a lot of different people with different specs and such. This is why you usually provide players with graphical settings so they can adjust it to suit there machines.

 

Now, I haven't made anything myself as of yet, but currently working on clones of games while adding to my own ideas and documents. How does resolution actually work? When you display a 2D game, you have all of the sprites in specific positions, when you increase the resolution of a game, those positions are going to change and aren't the sizes of the sprites going to change as well?? I have only messed with viewports in SFML before, so not 100% sure on how it all works, or even if that's the right thing to use.

 

Do you develop your games based around 1920 x 1080, or do you have to reset the positions and sizes of sprites, collision detection, etc. around different resolutions??


LazyFoo's Per-Pixel Collision Tutorial (SDL)

14 June 2013 - 05:52 AM

I have been working through these tutorials for a while now. I have been stuck a few times, but managed to overcome it on my own or through some very helpful posters on here.

 

I have the program all and running. The program displays to circles of the same size and you are meant to move one circle towards the other and they will collide together. Once they meet, the circle stops.

 

The problem I am having is with keyboard input. I've got it working in previous tutorials, but I have been slowly changing my code to spread across multiple header files and source files to make it easier to read.

 

I can't upload the project because it's too big as a whole. I also have trouble getting code to appear properly without it looking like a mess and readable on here.

 

I guess I will upload an image of each section that I am having trouble with.

 

 

Okay, from the image. The first section is where I poll for events. I then try to retrieve input for my dot object. I send that same Event structure to the function which is shown in the second section. It checks for the key down event and checks the type of key that was pressed and increases or decreases the velocity of the circle depending on the key that was pressed. It also checks to see if that key was released and then sets the velocity to 0 making the circle stop moving. Again, if nothing was pressed, it goes back to the first section and checks to see if the type of event was a quit event, control is returned to the main function in the third section.

 

In the third section, if the function returned false, quit becomes true and the program exits. This event works, it quits when I press on the 'X'. If I didn't press 'X', the program should return control to main and move the circle as shown in the function moveSprites(), clears the screen to white, displays the circles, flips the back buffer and caps the frame rate to 20 FPS.

 

 

It seems like a lot to follow, but for some reason, the circle just isn't moving. I've been through my code a hell of a lot and I can't see what the problem is. I've compared it to a previous SDL project and I've only changed a few things, and all I have done is handled all of my input inside the SDLManager class. I've even tried changing this project to closely match my previous project and it's still not working.


Lazy Foo's Tutorial 17 (Collision Detection)

03 May 2013 - 05:41 AM

Hey, I am currently working through Lazy Foo's tutorials. I have been doing pretty well with the previous tutorials. Obviously running into walls, but managed to get passed them due to silly little errors or mistakes I couldn't see which were to blatant when I finally did find the problem...

 

Anyway, the problem I am having is with the Timer class. I've got it working in previous projects, but it's just cooperating in this one project.

 

The function I am talking about is it returns the time in milliseconds, but it is all based on whether the timer is running and if it's paused or not.

 

 

I have uploaded my project. It's probably not perfect, but I am just trying to get it up and running before I make modifications, add more comments and such. I can't seem to copy and paste code properly, it just comes out as a jumbled mess with huge gaps between nearly every word and it would take me ages to sort it out, so it just quicker to upload my project and you can have a look through it all.

 

Like I said, it's just the Timer class giving me trouble. It just stops at the getTicks() function when I debug. It stops at the first line in that function which is:

 

if(started == true)

 

 

Now this exact class works in other projects.


PARTNERS