• What do you need help with? V. 3.0
    4,884 replies, posted
[QUOTE=Map in a box;32872092]snip [editline]20th October 2011[/editline] What is it supposed to draw?[/QUOTE] Whit square (as big as the screen)(red in complete version) It started off as a textured 2d object and during trying to find the error it simplified to this code, i have no clue whatsoever why its not working. Every frame i check glGetError but find nothing
Nothing there shows the color black in the code
[QUOTE=Map in a box;32872721]Nothing there shows the color black in the code[/QUOTE] Sorry i meant white, (its in the fragment shader)
[QUOTE=Map in a box;32871686]Just offset it by the camera position, iirc: [code] x=sprite.x-cam.x; y=sprite.y-cam.y; [/code][/QUOTE] I meant like this; Currently, all of my direction changes are being handled in the world grid, like in the first panel. This only allows me to move in directions manually, and it doesn't account for sprite rotation. I'm trying to figure out how to make movement like figure B, where it works off of the sprite's local coordinates. [img]http://dl.dropbox.com/u/12024286/graph.png[/img]
[QUOTE=Mr. Smartass;32873823]I meant like this; Currently, all of my direction changes are being handled in the world grid, like in the first panel. This only allows me to move in directions manually, and it doesn't account for sprite rotation. I'm trying to figure out how to make movement like figure B, where it works off of the sprite's local coordinates.[/QUOTE] Are you familiar with vectors and trig functions? You could adjust movement with vectors based on the sine and cosine of your rotation.
[QUOTE=RiceWarrior;32869231]I have been struggling to get SFML to work properly on Ubuntu with Code::Blocks, can anyone give me a tutorial or something? I'm pretty sure I linked the libraries properly but I'm still getting this error. Here's my example code: [code] makeprettywindow(); [/code] And here's the error: [code] /home/justin/Desktop/MyPrograms/SFML/main.cpp|11|error: ‘class sf::RenderWindow’ has no member named ‘PollEvent’| [/code][/QUOTE] You must be using 1.6 instead of 2.0, because PollEvent is new for 2.0 I think.
Best IDE for web development?
[QUOTE=Shooter;32874391]Best IDE for web development?[/QUOTE] Sublime Text 2
I must have pushed a button or something because there are now lines between everything instead of spaces. does anyone know how i can remove them? im using microsoft visual c++ 2010 express cant you help instead of rate me :S
[QUOTE=arleitiss;32859380]Any good place to start learning JavaScript? Atm I know only xhtml, css, and a bit of java. Looking for website or videos where it would start completely from scratch teching javascript. Thanks.[/QUOTE] [url]http://www.codecademy.com/[/url] is a great site for learning JavaScript. You actually get involved in each lesson, if you know what I mean. Visit the site and find out. It's pretty cool.
[QUOTE=Clio;32875901]I must have pushed a button or something because there are now lines between everything instead of spaces. does anyone know how i can remove them? im using microsoft visual c++ 2010 express cant you help instead of rate me :S[/QUOTE] Does it happen in other places where you type things? If so, check your system settings, your keyboard, and make sure you are pressing space instead of enter. If not, you will have to fiddle with MSVC++ settings. Most likely MSVC++ has nothing to do with it.
i dunno what msvc++ is :S anyways, i pressed a button or a button combination and all of a sudden all spaces i had made and made afterwards were tiny lines instead of empty spaces its really weird and confusing :S
[QUOTE=Clio;32878891]i dunno what msvc++ is :S[/QUOTE] Microsoft Visual C++
[QUOTE=Clio;32878891]i dunno what msvc++ is :S anyways, i pressed a button or a button combination and all of a sudden all spaces i had made and made afterwards were tiny lines instead of empty spaces its really weird and confusing :S[/QUOTE] Can you take a picture of what it looks like?
i can post a picture tomorrow but also i saw that everytime i press tab, it makes a long empty space with an arrow in it which looks kinda like this: ->
[QUOTE=Clio;32879741]i can post a picture tomorrow but also i saw that everytime i press tab, it makes a long empty space with an arrow in it which looks kinda like this: ->[/QUOTE] Try unchecking the option "View White Space" under Edit->Advanced
[QUOTE=Dragonsdoom;32873868]Are you familiar with vectors and trig functions? You could adjust movement with vectors based on the sine and cosine of your rotation.[/QUOTE] I am unfortunately not familiar with any of that. Is there any sort of alternative method I could use?
[QUOTE=Mr. Smartass;32881750]I am unfortunately not familiar with any of that. Is there any sort of alternative method I could use?[/QUOTE] Probably not. On the other hand, it's not impossible to learn without a teacher. Here is part 1 of a crash course on the subject, don't worry about part 2 or part 3 yet: [URL="http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-1/"]http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-1/[/URL] Vectors are really useful; you can use them to represent velocity, position, target position, acceleration, projectiles, lots of stuff. Think of a vector as an array of floats 2, 3, or 4 indexes long. Each index represents a dimension of movement. So if you have a grid 10 by 10, and rows(X) are the first dimension and columns(Y) are the second, then the value of position[0] is your X position, and the value of position[1] is your Y direction. The second thing I referred to was 'trig functions.' The study of Trigonometry is all about the relationships between triangles, circles, and vectors, but most importantly triangles. Wikipedia says it's often taught in junior high, or more in depth as part of a precalculus course in high school. It's quite common that everyone who doesn't use it completely forgets it, so it's not uncommon to see it taught as a required class in college as well. (As a related side note, I find that if you research something about hard science on Wikipedia, it's usually worth it to check to see if simple.wikipedia has an easier to understand article on the subject. Here is [URL="http://en.wikipedia.org/wiki/Trigonometry"]http://en.wikipedia.org/wiki/Trigonometry[/URL] and here is [URL="http://simple.wikipedia.org/wiki/Trigonometry"]http://simple.wikipedia.org/wiki/Trigonometry[/URL]) Okay so here's the idea: thanks to the magical relationship of triangles and circles, trig provides several handy mathematical functions that spit out angles when you feed them some scalars, or vice-versa. Think of mathematical functions as functions or methods from your native programming language. (Your programming language is based on many principles of math.) The ones you should familiarize yourself with are Sin, Cos, Tan, and the sort-of-but-not-exactly reverse operations Arcsin, Arccos, and Arctan. Sin is pronounced 'Sine' cos 'CoSine', and tan 'tangent'. Sometimes arcwhatever is written as whatever−1, with the −1 in supertext like it was raised to a power. Your language's Math class or library should have functions/methods built into them for those various operations, and usually one for arctan2 which is a bit handier. [B] So how do I use all this!?[/B] Well, I would try to do some basic math problems first. You should be able to find plenty at various math sites around the web. I'd recommend getting a fairly good understanding of how the functions work before messing about in code, unless you have a simple scripting language like python to play with. Once you get that under your belt, you can apply your rotation and position variables to the trig functions to make them influence each other. If you have two positions, you can get an angle. If you have an angle and a position, you can get another position by applying the trig formulas. More advanced stuff can be done as well, like [URL="www.indiedb.com/games/gravitybomb"]gravity physics games[/URL]. Of course, if you don't have a decent understanding of algebra you won't get very far with this. If you don't have a strong grasp on algebra and how to make things like 3*x = 17 turn into x = 51 [B]or[/B] x/8 = 4 turn into x = 32, then I strongly recommend enrolling at a nearby community college or in some kind of tutoring program. They often have classes for people who need to get caught up on basic math before they take college level courses, and the classes are super cheap. For instance at my college they offer a 4 credit hour class on basic algebra for about 220 dollars, and it runs probably about two or three class periods a week for 16 weeks. That's a bargain considering how many professions you can better qualify for with simple algebra or trig knowledge. Any questions just ask, even stupid ones. (You might just want to PM the stupid ones though.)
[QUOTE=Dragonsdoom;32883382]Probably not. On the other hand, it's not impossible to learn without a teacher. Here is part 1 of a crash course on the subject, don't worry about part 2 or part 3 yet: [URL="http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-1/"]http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-1/[/URL] Vectors are really useful; you can use them to represent velocity, position, target position, acceleration, projectiles, lots of stuff. Think of a vector as an array of floats 2, 3, or 4 indexes long. Each index represents a dimension of movement. So if you have a grid 10 by 10, and rows(X) are the first dimension and columns(Y) are the second, then the value of position[0] is your X position, and the value of position[1] is your Y direction. The second thing I referred to was 'trig functions.' The study of Trigonometry is all about the relationships between triangles, circles, and vectors, but most importantly triangles. Wikipedia says it's often taught in junior high, or more in depth as part of a precalculus course in high school. It's quite common that everyone who doesn't use it completely forgets it, so it's not uncommon to see it taught as a required class in college as well. (As a related side note, I find that if you research something about hard science on Wikipedia, it's usually worth it to check to see if simple.wikipedia has an easier to understand article on the subject. Here is [URL="http://en.wikipedia.org/wiki/Trigonometry"]http://en.wikipedia.org/wiki/Trigonometry[/URL] and here is [URL="http://simple.wikipedia.org/wiki/Trigonometry"]http://simple.wikipedia.org/wiki/Trigonometry[/URL]) Okay so here's the idea: thanks to the magical relationship of triangles and circles, trig provides several handy mathematical functions that spit out angles when you feed them some scalars, or vice-versa. Think of mathematical functions as functions or methods from your native programming language. (Your programming language is based on many principles of math.) The ones you should familiarize yourself with are Sin, Cos, Tan, and the sort-of-but-not-exactly reverse operations Arcsin, Arccos, and Arctan. Sin is pronounced 'Sine' cos 'CoSine', and tan 'tangent'. Sometimes arcwhatever is written as whatever−1, with the −1 in supertext like it was raised to a power. Your language's Math class or library should have functions/methods built into them for those various operations, and usually one for arctan2 which is a bit handier. [B] So how do I use all this!?[/B] Well, I would try to do some basic math problems first. You should be able to find plenty at various math sites around the web. I'd recommend getting a fairly good understanding of how the functions work before messing about in code, unless you have a simple scripting language like python to play with. Once you get that under your belt, you can apply your rotation and position variables to the trig functions to make them influence each other. If you have two positions, you can get an angle. If you have an angle and a position, you can get another position by applying the trig formulas. More advanced stuff can be done as well, like [URL="www.indiedb.com/games/gravitybomb"]gravity physics games[/URL]. Of course, if you don't have a decent understanding of algebra you won't get very far with this. If you don't have a strong grasp on algebra and how to make things like 3*x = 17 turn into x = 51 [B]or[/B] x/8 = 4 turn into x = 32, then I strongly recommend enrolling at a nearby community college or in some kind of tutoring program. They often have classes for people who need to get caught up on basic math before they take college level courses, and the classes are super cheap. For instance at my college they offer a 4 credit hour class on basic algebra for about 220 dollars, and it runs probably about two or three class periods a week for 16 weeks. That's a bargain considering how many professions you can better qualify for with simple algebra or trig knowledge. Any questions just ask, even stupid ones. (You might just want to PM the stupid ones though.)[/QUOTE] I'm just now starting with XNA, and I knew I was missing one of the really difficult bits- Ah well, at least I get to learn new stuff that I can apply to much more complicated projects in the future.
[QUOTE=Samuka97;32874270]You must be using 1.6 instead of 2.0, because PollEvent is new for 2.0 I think.[/QUOTE] Thanks, yeah you were right about that one. It's compiling correctly it looks like now but I'm still getting a weird error. I'm pretty sure an 800 x 600 window is supposed to pop up, but it's only the terminal. Again, here's the code I'm using. I'm pretty sure I linked the correct libraries as well. [code]#include <SFML/Window.hpp> int main() { sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window"); bool Running = true; while (Running) { App.Display(); } return EXIT_SUCCESS; } [/code] Here's my console error: [img]http://i56.tinypic.com/2e3se1f.png[/img] Any help would be appreciated. I'm not even sure if this is an error though...
What's the best method of displaying animated images in XNA?
[QUOTE=Mr. Smartass;32884396]What's the best method of displaying animated images in XNA?[/QUOTE] Most people use spritesheets. [URL="http://xnagif.codeplex.com/"]Here's a gif support library.[/URL] I'm using a combination of spritesheets and orthogonal 3D camera work.
[QUOTE=RiceWarrior;32884370][img]http://i56.tinypic.com/2e3se1f.png[/img][/QUOTE] That's a rather cryptic message; I believe either you're not linking libraries correctly or the libraries you have installed are broken. Add me on steam and I'll help you get it worked out.
-figured it out-
[QUOTE=Naelstrom;32885448]That's a rather cryptic message; I believe either you're not linking libraries correctly or the libraries you have installed are broken. Add me on steam and I'll help you get it worked out.[/QUOTE] The dynamic linker tried to patch in Unicode::UTF8Offsets or whatever SFML has, and the shared library doesn't have it. Maybe it's a SFML 2.0 program trying to run?
[QUOTE=bean_xp;32879928]Try unchecking the option "View White Space" under Edit->Advanced[/QUOTE] there is no edit->advanced :S
[QUOTE=Philly c;32872141]I've always wondered how to do something like a planet renderer. I'm talking simply in terms of precision, not anything about planets because that's not what interests me as such. Obviously you can't just do floats and hope for the best. I've heard about keeping the absolute position as a 64 bit integer and then using relative positions with floats. Obviously by this terrible description you can see i'm way too stupid and don't understand how this would actually work. I've tried googling but I guess i'm searching all the wrong things and I haven't found anything decent on it. I'm pretty much asking for anything that can help.[/QUOTE] Best method I've seen is create a sphere, cut sphere in half, take one of the hemispheres and either make it larger or smaller, rinse and repeat like 1000 times. I've seen a program that does it, but now that I think about it its probably not what you want. It doesn't get down onto the surface very well I believe. On another note. Can anyone explain how to do bit manipulations. I got a problem I'm trying to solve but its kicking my ass. I need to convert (0x1234 >> 4) ^ 0x23 to decimal.
[QUOTE=darkrei9n;32887212]Can anyone explain how to do bit manipulations. I got a problem I'm trying to solve but its kicking my ass. I need to convert (0x1234 >> 4) ^ 0x23 to decimal.[/QUOTE] I'll solve your question for you as an example. [code](0x1234 >> 4) ^ 0x23[/code] First, I'd convert everything to binary. Each hex digit corresponds directly to four binary digits. [code](0001 0010 0011 0100 >> 4) ^ 0010 0011[/code] Then, you shift the bits to the right four. This loses the information, so we'll just disregard that '0100' completely. [code](0001 0010 0011) ^ 0010 0011[/code] The caret ("hat") operator is exclusive-or. If both input bits are the same, the output is 0. If both input bits are different, the output is 1. [code] 0001 0010 0011 ^ 0010 0011 = 0001 0000 0000 [/code] Then, you convert it to decimal simply by going through from right to left and adding up the powers of two. It's pretty easy in this case, it's just 2^8 = 256. [editline]21st October 2011[/editline] I realise I didn't really explain this, I just solved it for you. I'm not sure exactly the extent of your knowledge, so I'll start from the beginning. The unary (one input) operators, NOT and IDENTITY (really useless) [code] x NOT x IDENTITY 0 1 0 0 1 0 1 1[/code] The basic binary (two input) operators, AND, OR and XOR (exclusive or) [code] x y AND x y OR x y XOR 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 1 1 0 0 1 0 1 1 0 1 1 1 1 1 1 1 1 1 0[/code] Then you can also use the NOT on the output of each of these to produce NAND, NOR and XNOR. After this, there's the shifts - shift left by x number of bits, or shift right by x number of bits. You can more or less solve equations like regular maths equations with the order of operations to follow. It's best to make sure you convert every value into binary so you can work with them easily unless you're experienced enough to know you won't make mistakes trying to calculate in hexadecimal straight away.
[QUOTE=darkrei9n;32887212]Best method I've seen is create a sphere, cut sphere in half, take one of the hemispheres and either make it larger or smaller, rinse and repeat like 1000 times. I've seen a program that does it, but now that I think about it its probably not what you want. It doesn't get down onto the surface very well I believe.[/QUOTE] That's not what i'm asking. I'm really shit at explaining but it's not such a difficult concept. I mean how do you simulate the physics of such a gigantic space, in the case of planets from space down to the mm precision any regular game would have?
Working on a village simulator thingy. I have a village class and a generator class. When the game starts the generator randomly generates some villages and puts them in the villages list. Each village has a name value, a food value, a population value, etc. My dillema: I'm trying to get something like an 'attack' command in. You type "attack VillageName" and it searches for a village in "villages" with the name parameter "VillageName", then subtracts 100 food from that village, etc. How would I do something like this? I'm doing this in C#, btw. [IMG]http://i.imgur.com/qRydi.png[/IMG]
Sorry, you need to Log In to post a reply to this thread.