# Motoky

Members

24

183 Neutral

• Rank
Member
1. ## 3D Line Equation?

I've come across some books that are really detailed and go through how they solve something and I prefer. I hate books that just give you an answer without any meaning behind it and expect you to figure out for yourself if you don't have a clue what some symbols might even mean or why nothing is actually showing up on the internet because they have written it down differently.   Anyway, I got passed that and onto the next set of exercises which is about finding the slope, y-intercept for each equation and the number of solutions. Well, I thought that a system of equations had to consist of more than one equation, if they don't, then I am completely lost because not even my previous books showed a system of equations with just one equation...   Anyway, the equation is:   x + y = 7   So the slope would be -1. The y-intercept would be: y = -x + 7.   Earlier in the book it tells you that to find out how many solutions a system of equations has by checking to see if the slopes of both equations are the same. If they are NOT the same, it has one solution, if it does, you then need to find the y-intercept and check to see if b1 and b2 are the same. b1 in this question would be 7.   So I have m1 = -1, and b1 = 7. The answer gives me that, but with m2 = 1/3 and b2 = 2/3, with only one solution.   I know you mentioned that I should focus on the theory and I guess understanding how it works, but I just wish someone could shed some light on this one so I can move on. If all of the exercises are like this, where they are giving me false answers or not explaining how they got the answer, I just don't see the point in the exercises...
2. ## 3D Line Equation?

For 2D, the book gives you this formula to get the equation:   (y - y1) = m(x - x1)   y1 and x1 being the first coordinates. m being the slope.   So, one of the questions in the book is to find the equation of 2D points as well, like:   (0, 10) and (5, 0)   (y - 10) = m(x - 0)   m = (0 - 10)/(5 - 0) = (-10)/5 = -2   y - 10 = 2x   y = 2x + 10     Anyway, there is only a little bit of info in the book, the answer isn't even an equation, but it's a vector...   You have:   ?x = x2 - x1 ?y = y2 - y1 ?z = z2 - z1   So with the coordinates, (2, 0, -1) and (3, 4, 5), it would be:   ?x = 3 - 2 = 1 ?y = 4 - 0 = 4 ?z = 5 - (-1) = 6   This is why I was confused because it was asking for an equation, not a vector... The answers were a bit further on. So I got them right, but it wasn't really worded very well because I was trying to find an equation...   Thanks anyway.
3. ## 3D Line Equation?

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.
4. ## Books & Libraries

Thanks for the info, will definitely pursue into using ASIO in the near future as well as reading those books.   It's something I should consider doing at some point due to how heavily online gaming has become or even social networking involved in games. Very simple things like being able to share high scores across social networking sites, adding friends on mobile games or just general interacting with another players world.   With programs like an instant messenger, it's mainly for learning purposes, but you wouldn't need a server for that would you, or would you have one person lets say, open some sort of lobby that everyone can join, or be invited to.
5. ## Books & Libraries

Cheers, I had heard about ASIO, but wasn't too sure if it was still widely used. I haven't heard of RakNet.   I have heard people mention WinSock, is that used still, does it accomplish the same things that ASIO or RakNet do?   About the books, are they more practical learning or are they mainly just for reading purposes and not participating in exercises?   I would also like to ask, would be a good idea to learn about servers and setting up a server if I were to start learning about networking?   Another thing I want to mention is that I am currently learning how to use the SFML library, it has a built in Network Module, just wondering if that is also something I should look into. I am using an SFML book at the moment and I am pretty sure it includes network programming in that.
6. ## Books & Libraries

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.
7. ## How does resolution work?

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??
8. ## What library to choose to write games in C + +

I'm only in my early 20's and I started programming at like 17. I had no experience with any languages and was going into it blind. Didn't really have any idea which forums to go on, I did a bit of research and decided on using C++.   I have to say, it was difficult. I was having trouble with the most basic of programs. I also wasn't committed enough and wasn't studying enough each day.   I've been through a couple of books, some weren't very detailed and didn't really explain some of the basic stuff, so when I moved onto advanced projects, it was tough. I'm actually learning C+11, decided I needed a good book and to have a go at the new standard and I'm doing way better than I did when I first went into programming.   I tried out SDL, got through several lessons, but it just felt messy. A lot of the times my code wasn't working properly. The libraries weren't linking properly. It put me off it to be honest. I've just been learning C++ and dabbled in DirectX which I really enjoyed. Jumped into SFML last week, took a bit to get it up and running, was trying to get it running on Visual Studio 2012, but it just wasn't cooperating, so I went back into the 2010 version and got it up and running. It's so much easier to use. You will get windows and shapes up in minutes of programming. The names of classes, functions, etc. are very easy to understand. They have the documentation on the website.   I would recommend SFML for someone just beginning.
9. ## LazyFoo's Per-Pixel Collision Tutorial (SDL)

Yeh I can email it to you. Just make sure you have SDL all set up though.   PM me your Gmail.   Cheers.
10. ## LazyFoo's Per-Pixel Collision Tutorial (SDL)

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.
11. ## Lazy Foo's Tutorial 17 (Collision Detection)

I had a look through my code before looking at your reply and I noticed I hadn't even started the timer. I also initialized a Timer object in my Main source file along with the SDLManager header file. I was trying to start the timer with a different Timer object, but retrieve the FPS on another Timer object...   I decided to initialize my timer in my Main source file, get rid of it in the SDLManager. The program is up and running now, but still having a little trouble with the movement of the square, but I will sort that out myself. I've had this problem before and I managed to get it fixed before.     Thanks a lot though.
12. ## Lazy Foo's Tutorial 17 (Collision Detection)

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.
13. ## drawing clouds in a flight sim

I'm still a newbie, but I would probably suggest using some sort of particle system.   I did think of using a 3D model of a cloud, but when you go through it, it wouldn't display anything inside it. So a particle system would work well.     The way you would implement it would depend on what API or engine you are using.