Here's a short video showing my engine :v:
[media]http://www.youtube.com/watch?v=HY0qIhcWcV4[/media]
[QUOTE=Wyzard;27447229]If you have (or can easily obtain) vectors representing the directions the objects are facing, you can also just take the dot product of the two vectors and check whether the result is positive or negative.[/QUOTE]
I actually haven't done any vector math, I just taught myself basic vector operations, this makes sense though.
[editline]15th January 2011[/editline]
and our code just uses position and angle floats, and when we want stuff to move, we just have it interpolate to a spot over multiple frames. Once we start working on physics, we're probably going to change a few things up, and we're going to have to start representing things in vectors.
Ugh this is getting annoying. When I hook the global mouse/keyboard it ends up locking everything up for a few seconds when you use the title bar.
I was going to build an AST-based macroexpander for C piggybacking off libclang for parsing plus its builtin C AST.
Found out my copy of libclang (built with MSVC10) for some reason doesn't link with anything a generic error, spent an hour attempting the same with GCC and DMC only to get the same. Guh.
Physics almost working...
(Collision detection, gravity, friction, movement, jumping, etc)
[img]http://minipenguin.com/wp-content/uploads/2011/01/1-12-2011-2-54-35-PM-8a78.png[/img]
[QUOTE=HiredK;27423980]Alright, it's working :v:
[img_thumb]http://i53.tinypic.com/n224bm.png[/img_thumb][/QUOTE]
I want to lick it...
[QUOTE=HiredK;27449041]Here's a short video showing my engine :v:
[media]http://www.youtube.com/watch?v=HY0qIhcWcV4[/media][/QUOTE]
dat phong
3 separate perlin noise maps, each one representing red, green and blue.
[img]http://dl.dropbox.com/u/5062494/junk/perlin_rgb.jpg[/img]
Having so much fun with this noise.
[editline]16th January 2011[/editline]
[QUOTE=HiredK;27449041]Here's a short video showing my engine :v:
[media]http://www.youtube.com/watch?v=HY0qIhcWcV4[/media][/QUOTE]
Why is it rendering 130 polygons always? Should that label read "polygons in scene"?
Otherwise I would think the number of rendered polygons would change depending on where you are / where you look due to backface culling and frustum clipping.
[QUOTE=Dlaor-guy;27439571]Did anyone say perlin noise?
[img_thumb]http://anyhub.net/file/1ubH-gg.png[/img_thumb][/QUOTE]
How are you doing the stars? Are they sprites? Also how are you doing the glow of the stars?
I'm very curious. But I really like the look of it. : )
-snip-
[QUOTE=King Flawless;27451615]-snip-[/QUOTE]
How'd you manage to snip your post without even editing it?
[QUOTE=Chris220;27451679]How'd you manage to snip your post without even editing it?[/QUOTE]
Probably just posted -snip-.
;)
If you edit within a minute of posted it doesn't count as an edit.
[QUOTE=xAustechx;27451485]How are you doing the stars? Are they sprites? Also how are you doing the glow of the stars?
I'm very curious. But I really like the look of it. : )[/QUOTE]
They are generated on runtime. This is the code I use for generating the star sprite:
[cpp] StarTex.loadPixels();
for (int x = 0; x < StarSize; x++)
{
for (int y = 0; y < StarSize; y++)
{
float GrayAlp = dist(x, y, StarSize / 2, StarSize / 2);
GrayAlp = StarSize / 2 - GrayAlp;
GrayAlp = map(GrayAlp, 0, StarSize / 2, 0, 1);
GrayAlp = constrain(pow(GrayAlp, 6) * 255, 0, 255);
StarTex.pixels[x + y * StarTex.width] = color(GrayAlp); //Generate star sprite, basically just a glow sprite
}
}
StarTex.updatePixels();[/cpp]
(written in Processing)
Also, StarSize is 64. The horizontal and vertical streaks are just stretched out versions of this sprite.
[QUOTE=Dlaor-guy;27451829]They are generated on runtime. This is the code I use for generating the star sprite:
[cpp] StarTex.loadPixels();
for (int x = 0; x < StarSize; x++)
{
for (int y = 0; y < StarSize; y++)
{
float GrayAlp = dist(x, y, StarSize / 2, StarSize / 2);
GrayAlp = StarSize / 2 - GrayAlp;
GrayAlp = map(GrayAlp, 0, StarSize / 2, 0, 1);
GrayAlp = constrain(pow(GrayAlp, 6) * 255, 0, 255);
StarTex.pixels[x + y * StarTex.width] = color(GrayAlp); //Generate star sprite, basically just a glow sprite
}
}
StarTex.updatePixels();[/cpp]
(written in Processing)
Also, StarSize is 64. The horizontal and vertical streaks are just stretched out versions of this sprite.[/QUOTE]
Oh, that's a lot easier than I thought, thanks :D
[QUOTE=Pirate Ninja;27446630]Can anyone link me to that island/map generator that was posted the other day I'd appriciate that, thanks.[/QUOTE]
There are quite a few going around.. :v:
[QUOTE=Pirate Ninja;27446630]Can anyone link me to that island/map generator that was posted the other day I'd appriciate that, thanks.[/QUOTE]
[url]http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/mapgen2.swf[/url]
^ Don't forget the tutorial :
[url]http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/[/url]
I'm rewriting my space station game to work differently than it currently does (it will be more awesome). To do so I needed to be able to generate gradients between two colours or more in a certain amount of steps. Examples:
In 10 steps:
[IMG]http://filesmelt.com/dl/test35.png[/IMG]
In 100 steps:
[IMG]http://filesmelt.com/dl/test210.png[/IMG]
The drawing is just something hacky I implemented to test it (that's why they are different sizes). The actual class just generates a list of colours. It can do more than one colour in theory but I need to rework the way I'm generating the colours to get it to stop being so damn weird.
[QUOTE=Xerios3;27453270]^ Don't forget the tutorial :
[url]http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/[/url][/QUOTE]
Thanks, I forgot bookmarking that
[QUOTE=ThePuska;27446592]I've got special cases for linear, quadratic, cubic and quartic equations. The quartic equation was a bit tricky: it divides it into a product of two quadratic equations with unknown coefficients, and solving the coefficients is a cubic equation.
For greater degrees, it numerically finds one root. That's done with Newton's method (extended to the complex plane - I was surprised to find that the method seems to work perfectly even then). After it has the approximate root, the polynomial is divided by the root to get a new polynomial of a lower degree. The remainder's discarded because it's supposed to be 0. Repeat with the new polynomial.
Since polynomials behave so well, Newton's method is almost guaranteed to find a root and converge quickly with only a few conditions to check for.[/QUOTE]
Hey,
Wow, that's really cool!
When you say you divide the original polynomial by the (possibly complex) root, are you talking about synthetic long division, or something else? If long division, doesn't that result in [i]very[/i] messy polynomials?
[IMG]http://i52.tinypic.com/w1adqf.png[/IMG]
Working on a 2d planet rts game, at the moment I'm only just rendering the planet and placing units, but I'm going to (probably) implement pixel physics (think cortex command/tanks) and I'll use perlin noise to generate the terrain.
[QUOTE=CarlBooth;27454959][img_thumb]http://i52.tinypic.com/w1adqf.png[/img_thumb][/QUOTE]
They could also be $1 and $5 :/
[QUOTE=iNova;27455036]They could also be $1 and $5 :/[/QUOTE]
No that was just GMF trolls winding you up, it's the same price for everyone.
[editline]16th January 2011[/editline]
compwhizii just can't understand why his title-purchasing code won't compile
[IMG]http://i54.tinypic.com/23s7n8n.jpg[/IMG]
[QUOTE=iPope;27453925]I'm rewriting my space station game to work differently than it currently does (it will be more awesome). To do so I needed to be able to generate gradients between two colours or more in a certain amount of steps. Examples:
In 10 steps:
[img_thumb]http://filesmelt.com/dl/test35.png[/img_thumb]
In 100 steps:
[img_thumb]http://filesmelt.com/dl/test210.png[/img_thumb]
The drawing is just something hacky I implemented to test it (that's why they are different sizes). The actual class just generates a list of colours. It can do more than one colour in theory but I need to rework the way I'm generating the colours to get it to stop being so damn weird.[/QUOTE]
what kind of space station game? Like space station 13?
[QUOTE=robmaister12;27449149]I actually haven't done any vector math, I just taught myself basic vector operations[/QUOTE]
The dot product of two vectors equals the product of the lengths of the two vectors times the cosine of the angle between them. If your vectors are normalized (length 1), as is typical for vectors representing directions but not specific distances, the dot product is just the cosine of the angle between the vectors. Assuming you aren't using any negative-length vectors, it'll be positive when the angle between them is less than 90 degrees, and negative if the angle is greater than 90 degrees.
If you're interested in knowing whether the vectors are within some narrower angle of each other, like 45 degrees, you can take the cosine of the desired angle and compare against that. This can be done at compile time, or once at runtime during program startup, so the actual vector comparisons don't involve any trigonometry.
[QUOTE=robmaister12;27449149]and our code just uses position and angle floats, and when we want stuff to move, we just have it interpolate to a spot over multiple frames. Once we start working on physics, we're probably going to change a few things up, and we're going to have to start representing things in vectors.[/QUOTE]
Vectors are great for interpolation because you just take a normalized vector, multiply its components by the distance you want your object to move, and add the result to the object's coordinates. Again, no trigonometry needed.
Woo, SFML!
Never knew that SFML has .NET bindings. I have been enlightened!
[IMG]http://i.imgur.com/Aj8Um.jpg[/IMG]
First steps.
[QUOTE=limitofinf;27454612]Hey,
Wow, that's really cool!
When you say you divide the original polynomial by the (possibly complex) root, are you talking about synthetic long division, or something else? If long division, doesn't that result in [i]very[/i] messy polynomials?[/QUOTE]
Polynomial long division. The intermediary polynomials do get very unfriendly-looking, and I wouldn't want to do it by hand.
Oh look, distance between point on a circle and center of circle != radius when using distance formula. That is really crappy, I was hoping I could just add the height of the hill to the radius and get the distance needed (for collisions) for when I do dynamic terrain.
[QUOTE=neos300;27455875]Oh look, distance between point on a circle and center of circle != radius when using distance formula. That is really crappy, I was hoping I could just add the height of the hill to the radius and get the distance needed (for collisions) for when I do dynamic terrain.[/QUOTE]
Hey,
That doesn't make any sense. Are you perhaps using == on floating point numbers?
Sorry, you need to Log In to post a reply to this thread.