1,340 reputation
148
bio website
location Umeå, Sweden
age 28
visits member for 2 years, 4 months
seen 5 hours ago
stats profile views 86

C++ developer at heart, loves to play around with strange languages and graphics APIs.


May
15
comment For loop optimisation
@stephelton Indeed, but note that a reversed iteration order may have significant secondary effects on memory accesses done by the body.
Apr
2
comment Driver error when using multiple shaders
If your code relies on particular context state being set, explicitly set that state, and if you're nice, restore it or clear it out when done. That helps to avoid breaking code that isn't careful about setting the "right" state, and avoids leaving resources bound longer than necessary.
Mar
31
comment Setting up openGL on Linux
Even if you're not going to use a library, I would recommend that you look at the relevant source code in a library like GLFW3 that's licensed under a license that doesn't mind you looking at the source code. They've found and explored every single quirk there is out there, so being inspired by the functions and order they try things would probably be a Very Good Thing.
Mar
21
comment What are normal, tangent and binormal vectors and how are they used?
It might help to read this article on why the square-patch assumption is invalid and why everything everyone says about tangents and bitangents is pretty much bogus. It outlines the proper math one should use, but sadly I'm not competent enough to author a correct answer with it.
Feb
27
answered Compress / make Blender .obj file smaller
Feb
18
comment What's the best way of translating a 2D vector into the closest 8-way compass direction?
It's "pseudo-code" in a didactic manner. If you want panic-optimized implementations, GDSE is likely not the place to go for your copy-pasta. As for using float2 as a key, a float can exactly represent the whole numbers we use here, and you can make a perfectly good comparator for them. Floating point keys are only unsuitable if they contain special values or you try to look up computed results. Iterating over an associative sequence is fine. I could've used a linear search in an array, sure, but it'd just be pointless clutter.
Feb
18
comment Perlin Noise for game terrain; math error (unexpected breaks in terrain (3D grid))
Conversion to integer gives the integer in the direction of zero. floor gives the integer towards negative infinity. ceil gives the integer towards positive infinity. Integral conversion is like floor for positive numbers and like ceil for negative numbers.
Feb
14
revised What's the best way of translating a 2D vector into the closest 8-way compass direction?
Clarify pseudocode slightly
Feb
14
answered What's the best way of translating a 2D vector into the closest 8-way compass direction?
Jan
12
answered Confusing with an articles wording on Clamping a Vector2
Jan
10
awarded  Yearling
Dec
11
comment Scale a normalized 2D vector always to the same length
You seem to use the term normalized incorrectly. A normalized vector has unit length (1.0), while the ones you have in your example are definitely not of unit length.
Dec
2
comment 16-bit PNGs in Slick2D
Is this 16-bit per channel or 16-bit total for all channels? ImageMagick has a tendency to say 8-bit for most of the formats below 8 bits per channel.
Nov
30
comment As a indie, how to protect your game?
This answer seems to be interpret "protection" as "copy protection/DRM" and even worse, promote piracy. The question is about trademarks, copyright and other Fun Legal Stuff.
Nov
9
awarded  Nice Answer
Oct
29
comment “LNK2001: unresolved external symbol” when trying to build my program
In C++03, a static member must be defined in exactly one translation unit. You can omit the definition if the variable is static const integral and you don't ever take the address of it.
Oct
26
comment If I draw a rectangle, then extrude it, will it be identical to a box?
This question seems a bit out of place. Did you try it? Is there some particular behavior that happens that you do not expect? Is there some answer you're looking for to prove a point?
Oct
26
answered If I draw a rectangle, then extrude it, will it be identical to a box?
Oct
11
comment How can I handle copyrighted music?
The reason they use real, well-known music is because real, well-known music makes the product appeal to more people, selling more, making it well worth going through the pains of licensing and acquiring performances of well-known songs.
Oct
11
comment How can I handle copyrighted music?
Don't go guessing about things like this. Get proper legal advice from a real lawyer. "The internet told me so" is not a valid defense.