« first day (460 days earlier)      last day (4561 days later) » 

1:49 PM
any developer from cocos2d
 
 
2 hours later…
3:36 PM
I've got a some experience with c++ port of cocos2d
 
He's gone, you might want to add an @ his name
 
4:21 PM
never mind, I've seen his quesiton:
http://gamedev.stackexchange.com/questions/19519/load-20-sprite-in-the-same-ccp-point
but I could tell what was his problem.
 
yeah, it's a very confusing question
 
from what I know that code should work, there has to be some other piece of code which contains main problem.
 
user4704
The only thing "wrong" with the code is that it only does three sprites. But he can't explain himself well at all.
 
user4704
So probably that code is completely unrelated to his real query.
 
user4704
Also he's being a bit of a jerk.
 
4:31 PM
it doesn't help that he hasn't done a very good job explaining what the problem actually is, which i'm sure is a language barrier issue as opposed to anything else.
and he is being a bit of a jerk
 
user4704
I strongly dislike when people say things like "I want to use {x} because that's what the professionals do!"
 
user4704
Especially when {x} is C++.
 
@JoshPetrie hahah, Yeah
I was reading that question/answer too
 
user4704
I edited that bit out because it made me rage and was irrelevant
 
probably smart
 
4:38 PM
It's not entirely wrong
 
user4704
It's misguided.
 
user4704
This guy in particular said it was because he wanted to "learn how the professionals do it," and the professionals don't "use C++."
 
user4704
They "use the appropriate tool for the job."
 
The HD question a little while back also made me laugh
 
C++ isn't usually the appropriate tool for any job, but it's what a lot of companies use.
 
4:39 PM
I love @Tetrad's answer to the guy's question: "Yes... Unity supports HD"
 
my application at work features a 3000 pixel wide data grid..... can I claim I support super-HD?
 
@Jimmy yeah, I agree. If you're aiming for the highest end performance, you can go for C++, but it's rare for indie/hobby programmers to ever really need that
Go for ease over performance
 
well, in a high level language you get performance via ease of implementing smarter algorithms.
 
yeah, I guess you can... in a sense
heh, why do I always relate real-world problems to xkcd comics: xkcd.com/909 (worst case shopping)
 
The programmer in me claims that you only optimize the big-O of the worst case.
or that you profile your real-life flashlight usage first before deciding.
 
4:52 PM
yeah, I agree. People that constantly preoptimize really bug me, to put it politely
A friend of mine does that all the time, and it's one of the reasons he and I have stopped talking about programming
 
yeah, coding should be optimized for legibility first. Although I find that legibility is quite subjective.
Or at least, that's what my coworkers tell me after reading my code.
 
:p
just as long as people aren't trying to be tricky in their code. I found this one piece where they had weaved an if/else with a #ifdef /#else and it was such a mess to pull apart so that I could add a single line
 
lol ouch
 
very ouch
 
at least they didn't also have gotos in there
I find upwards gotos in nested if/else nearly impossible to decipher.
 
5:00 PM
#ifdef ALLOW_GOTOS
goto 10
 
downwards gotos are okay usually
not that I use them, but they are comprehensible.
 
:D I found the psudo-code I wrote myself:
if(someCondition)
{
   // some block of code
   // .
   // .
   // .
#ifdef 32BIT_REGS
   foo(1);
}else
#else
}
#endif
bar(2);
 
oh confusing
 
And I needed to add a function call right infront of both foo(1) and bar(2), different calls for each
Notice that the "}else" hangs open for bar(2); if compiled with 32BIT_REGS
 
:( lovely
 
5:03 PM
yeah, that was a fun day
So: No making puzzles in your code!
 
5:29 PM
It gets real tricky when you combine those things with inlined assembly. :P
 
 
3 hours later…
8:59 PM
Is there anything like a TranslationScale matrix? Using a Translation matrix, I can offset the x, y, z values, but what if I want to scale the x, y, z values?
 
I think a scale matrix is a diagonal matrix
and can't you just combine the matrices?
just make sure to scale before transform
 
Matrix scaleMatrix = Matrix.CreateScale(this.scale, this.scale, 0.00f);
Matrix translationMatrix = Matrix.CreateTranslation(((FullView.Width - GameView.Width) / 2.00f) - this.world.ActiveRealm.RenderLocation.X, ((FullView.Height - GameView.Height) / 2.00f) - this.world.ActiveRealm.RenderLocation.Y, 0.00f);
Matrix matrix = scaleMatrix * translationMatrix;
That's what I'm currently doing.
The scaleMatrix will scale the texture size.
The translationMatrix will fix the x and y coordinates.
What I need, is to also scale the x and y coordinates.
But I don't know what kind of matrix scales the coordinates.
 
hmmm
if you apply the scale after the translation
wouldn't it also apply to the translation?
 
10:03 PM
meaning: Matrix matrix = translationMatrix * scaleMatrix should apply the scale to the translation.
 
Does the exact same. Maybe matrixes can't scale coordinates, only offset them?
 
does your translationMatrix actually get applied?
 
Yea
 
:( hmm
 
10:19 PM
@MindWorX How do these matrices work, exactly? Because scale (and rotation) is usually applies as multiplication, and translation as addition, so it's not easy to combine them into one matrix (or number, really).
 
well, here's my test code (using OpenTK vectors, I dont' have XNA handy)
var point = Vector4.One;
var scale = Matrix4.Scale(2f);
var translation = Matrix4.CreateTranslation(10f, 10f, 10f);

var matrix = scale * translation;
var matrix2 = translation * scale;
Console.WriteLine("Input: {0}", point);
Console.WriteLine("Result: {0}", Vector4.Transform(new Vector4(point), matrix));
Console.WriteLine("Result: {0}", Vector4.Transform(new Vector4(point), matrix2));
 
I must admit I don't know for sure, I've never used Matrices before. I just kinda wanted to test them a bit. But it seems I can't translate with a factor.
 
Input: (1, 1, 1, 1)
Result: (12, 12, 12, 1)
Result: (22, 22, 22, 1)
 
@MindWorX I didn't say it was impossible, just not easy. In 3D, that's done with dual quaternions (those can describe rotation, scale and translation in a single 8x8 matrix).
Actually ... in an 8-tuple, which gets modified into a special form of an 8x8 matrix.
 
Sounds like it'd be easier if I just make a method that does it for me instead.
 
10:25 PM
@Jimmy: Can you check how the scale and translation matrices look like internally?
 
@MartinSojka : as you'd kind of expect
well, as I'd kind of expect
Translation
  (1, 0, 0, 0)
  (0, 1, 0, 0)
  (0, 0, 1, 0)
  (10, 10, 10, 1)
Scale
  (2, 0, 0, 0)
  (0, 2, 0, 0)
  (0, 0, 2, 0)
  (0, 0, 0, 1)
scale * Translation
  (2, 0, 0, 0)
  (0, 2, 0, 0)
  (0, 0, 2, 0)
  (10, 10, 10, 1)
Translation * scale
  (2, 0, 0, 0)
  (0, 2, 0, 0)
  (0, 0, 2, 0)
  (20, 20, 20, 1)
 
Yeah, 3x3 matrix for the scale/rotation part, extended by another row/column for translation (and projection).
translation * scale then translates, then scales (around the origin), scale * translation does the opposite.
 
MindWorX wants to translate then scale because he wants the scale to apply to the translation. But that's what Translation * scale does for me
 
With this setup, it should do it, yes.
 
oh wait, perhaps your W-coordinate is 0
it needs to be 1 for the translation to get applied
 
10:35 PM
Shouldn't it be 1 by default for newly created vectors?
... and renormalised whenever it isn't 1 after an operation.
 
I don't know. In OpenTK, new Vector4(new Vector2(5,5)) = (5, 5, 0, 0)
I guess it depends on the implementation
 
I guess it doesn't bother with normalisation for 2D vectors. :D
... or maybe it just sets w=0 => vector is 2D.
 
I imagine it just defaults everything to zero because that's what people usually expect
because a Vector4 isn't necessarily always a homogeneous coordinate either.
 
11:03 PM
@Jimmy Maybe it just differentiates between a vector (which can be rotated and scaled, but not meaningfully translated) and a point. I wouldn't know, didn't look much into OpenTK yet.
 
11:14 PM
I love LINQ
var ray =
        this.world.ActiveRealm.Raytrace(new Vector2(this.world.ActiveRealm.RenderCenter.X, this.world.ActiveRealm.RenderCenter.Y), new Vector2(inputPoint.X, inputPoint.Y))
        .Select(point => new Point(point.X / TileWorld.TILE_SIZE * TileWorld.TILE_SIZE, point.Y / TileWorld.TILE_SIZE * TileWorld.TILE_SIZE))
        .Distinct()
        .ToList();
First I perform a raytrace, convert the coords to tile cells, remove the duplicates and return it as a list.
I guess I don't need to convert it to a list though.
 
nice
 
What does Select() do?
Ah, it's Map. Just found it.
Silly Microsoft using non-standard names for things.
 
Microsoft tried to make the names look like Sql
so map is select, filter is where
reduce is aggregate
 

« first day (460 days earlier)      last day (4561 days later) »