Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Zeracles

Pages: [1] 2 3 ... 29
1
At first it looked very useful. Then I noticed that the thread was from 2002.
I'm cataloguing old threads (so things like this will be easier to answer), starting at the beginning. I'm not yet done with 2002 (UQMF had a LOT of threads back then), but if something more recent about this turns up, I'll let you know.

2
May not be very useful, but there's this.

I remember someone saying that the original picture of Talana is hanging on a wall in TFB office.
I wonder if this is more distracting than it is motivating . . .

3
General Discussion / Re: 3D rendering program
« on: March 15, 2010, 11:11:19 pm »
Say Eth, you mean payment in karma, right? 1 karma per polygon, perhaps? It might take kc a while to pay you :P

I need a program that I can render 3D images
I'm developing my own. Beat that 8) Er, oh, you wanted a serious suggestion? Never mind.

4
Off Topic / Re: Did I miss anything?
« on: March 13, 2010, 08:10:31 pm »
Well, so can centenarians.

nothing says "Nostalgia" like staring at Geomans profile 8)
I think he's been active at Timewarp's forum more recently than here, for some reason.

5
General Discussion / Re: Looking for a SC2 Website w/controls
« on: March 13, 2010, 07:58:11 pm »
Is there a website here or elsewheres, that has a keyboard/control panel with what keys do what.
Yes. It should also be in your UQM directory, called ``manual".

6
Off Topic / Re: Did I miss anything?
« on: March 13, 2010, 07:44:31 pm »
Her profile says she was here just a year ago. I assume that's when she changed her avatar, and the text from ``Some serious shit" to ``GRIMD'AWWNESS", implying that at least then, she intended to post here.

I didn't know that three-year-olds used the internet!   ;D
Oh yes they do! He was one of our best posters. However could you forget, Eth? ;)

7
Digital art, 3D models, graph theory, Dragon's awesomeness, a dash of cricket, sand dun The thread gets longer, Dragon's karma goes up, and mine goes down. Simple ;)

8
No-one should get the wrong idea here, Dragon is a much better coder than me. Matlab is a language that allows people like me with no real computing background (I haven't done any computer courses) to avoid a lot of low-level stuff.

I think that's all I use it for here, but linspace is more general; linspace(a,b,n) creates a 1-by-n vector
Just to be sure to be sure.  This creates a row right, not a column?
Yep, a row.

Would linspace(a;b,n) have create a column or am I trying to be clever?
That's a brilliant inference, but semicolons don't mean anything in matlab function arguments as far as I know, unless they're being used within [] to construct arrays.

Code: [Select]
maskvector=treenumber==tree;
treeindices=find(maskvector);
lengthtreepositions=sum(maskvector);

remainingpositionxs=inputpositionxs(find(maskvector==0));
remainingpositionys=inputpositionys(find(maskvector==0));
I'll start by explaining what this does - I think you've got it, but just to be sure.

It all works by joining together trees. Each tree grows and is joined to nearby ones. This involves looking around each tree for nodes from other trees that are nearby. The first step here is to isolate the nodes of one tree. treeindices does this. lengthtreepositions is the number of nodes in this one tree, and the for loop a few lines later is where the searching is done, it visits each node of the tree, so i counts to lengthtreepositions.

Taking a look at this code here (and let's assume 5 points/trees to start with and that the tree we're dealing with is number 2).  Does this mean that:
maskvector equals [0,0,1,0,0].
treeindices equals 3 (the only non-zero in the vector
That's right, assuming you meant tree number 3.

lengthtreepositions equals... wait a minute?  Does maskvector become something like:
Code: [Select]
0,0,1,0,0
0,0,1,  0
0,  1,  0
*kicks self* I should have explained - the sum function arithmetically adds together all the elements of a vector (I don't think I use it on a matrix anywhere here). maskvector remains a vector, and lengthtreepositions is a scalar equal to the number of nodes contained in the current tree.

So first time around lenghtreepositions will equal 1 and later on more elements are added to the columns?
lenghtreepositions starts at one and increases as the number of ones in maskvector grows.

and finally remainingpositionxs and remainingpositionys both become [1,2,4,5]?
They'll become the xs and ys corresponding to the indices [1,2,4,5], yes.

Lasty, a general matlab question: Can an element in a matrix be a matrix itself?  I haven't worked out whether branches is using something like that or not.
No, but I can totally see what you're thinking. Matrices can be put together in the same way as scalars to form larger matrices. The individual elements of the ``ingredient" matrices then become individual elements of the resultant matrix. If I make a 4-by-4 matrix a, and another 4-by-4 matrix b, c=[a,b] would be a 4-by-8 matrix.

I'll go through exactly how branches evolves. It does indeed do the sort of thing I just described.
Code: [Select]
branches=[];
At the beginning, initialised as a 0-by-0 array.

Code: [Select]
mindistancecandidates=[mindistancecandidates;mindistancecandidate];
mindistancecandidateindices=[mindistancecandidateindices;branchcandidateindex];
When searching around the nodes of a particular tree to find potential linkees, many distances are stored so they can be compared later (we want the minimum distance). These distances are mindistancecandidates, and their indices are mindistancecandidateindices. We get this pair for each node of the current tree.

Code: [Select]
mindistance=[min(mindistancecandidates),treeindex,mindistancecandidateindices(find(mindistancecandidates==min(mindistancecandidates)))]; % minimum distances carry the indices of the prospective link destination
mindistances=[mindistances;mindistance];
Once we have all the neighbouring distances, we find the minimum, which is mindistance. It's a row vector, at this point I get it to carry the 2 indices of the potential link nodes, treeindex and . . . the other one. mindistance is the minimum distance for a single node of the tree. mindistances stores the minimum distances for all nodes of the current tree.

Code: [Select]
branchdistance=min(mindistances(:,1));
branchindex=find(branchdistance==mindistances(:,1));
These are the precursors to branch. For the current tree, we want the minimum distance from any node of that tree to any node outside that tree. This means we want the minimum (branchdistance) of the minima (mindistances) found at each node.

Code: [Select]
branch=mindistances(branchindex,:);
Here, the appropriate row of mindistances is selected and then -

Code: [Select]
branches=[branches;branch];
This is where branch is added as a row to branches. The final result of the code is a matrix with as many rows as there are MST links, and 3 columns. Each row has the length of the link and the indices of the two endpoints.

I'm sort of rubber ducking here/thinking aloud/whatever but I'm slowly starting to understand.  Please be patient, there's going to be a lot more questions yet...
No worries :), I don't visit this place every day though, so I won't always be able to reply straight away.

In other news, this thread has broken into the forum's top 10!

9
Off Topic / Re: World of Goo
« on: March 05, 2010, 06:45:28 am »
Wow, I just realized that Zeracles has been updating this post.  Zeracles, you continue to amaze me!
Well, what can I say? Your comedic powers, manifest in your avatar text, continue to amuse me!

Though, come to think of it, I have been seriously considering doing a Star Control webcomic.  I have several strips roughed out already.  We'll see how I feel about when I've graduated (in about four months). 
;D

10
Off Topic / Re: Things your country doesn't "get"
« on: March 05, 2010, 06:39:00 am »
The English and Australians do not get the concept of "Left" and "Right".

. . .

Somehow they still believe that Left is Right and Right is wrong.
But those two wrongs make a right! ;D

Oh yeah, we didn't get a recession to recover from :P

11
Sorry :'(

Does linspace create an integer array of 1..lengthinputpositions of length lengthinputpositions?
I think that's all I use it for here, but linspace is more general; linspace(a,b,n) creates a 1-by-n vector which contains values (not necessarily integers) linearly spaced between and including a and b. I think in the code I posted, I mostly do linspace(1,n,n), which just counts integers from 1 to n.

>> linspace(1,10,10)
ans =
     1     2     3     4     5     6     7     8     9    10

>> linspace(1,pi,4)
ans =
    1.0000    1.7139    2.4277    3.1416

In the instance you quote, I'm just numbering the trees, which to begin with are the input points themselves.

what does transposing it do?  I'm assuming it's changing it from a vector Ai1 to A1i but I don't understand why.
Yep, that's exactly what it does. Here, it's from an earlier version of the code in which it was necessary, but now it isn't so I've removed it. I think I transposed it to get a column vector I could attach as a column to one of the other arrays.

EDIT*: But I transpose elsewhere in the code, because to feed elements of a vector into a for loop,

for i=somevector
   ...
end

the vector needs to be a row vector. Otherwise, there will only be one i, and it'll be a column vector. So I only transpose to put a vector in the right shape for iterating. Partly because of this, I like the way C does loops, but anyway - I don't think you'll have to tranpose at all.

Code: [Select]
remainingpositionxs=inputpositionxs(find(maskvector==0));What does this code do?  I gues the == is a check for equality
Yes. == < <= > >= all return 1 if the relational condition is satisfied (and zero otherwise).

>> [-2,-1,0,1,2]==1
ans =
     0     0     0     1     0

>> [-2,-1,0,1,2]>=1
ans =
     0     0     0     1     1
     
does that 'find' then filter out all the zeros from inputpositions?
Right again - find returns the indices of all nonzero elements of a vector. If the vector was row or column, find(vector) will be row or column respectively.

>> find([-1,0,1])
ans =
     1     3

because only the second element is zero.

So find is handy for retrieving indices of elements that satisfy some condition.

Does unique imply that the array it returns is sorted in anyway or does it give the unique elements in the order that they're found?
It gives unique elements in ascending order.

>> unique([1,1,4,3])
ans =
     1     3     4

But as with the transpose thing, it's a redundant operation from an earlier version of the code, and I've removed this too.

Also does 'length' return the same result as numel?
For a vector (which is all I use it on here), yes.

Okay, now I'll see if I can spot anything else . . .

In a few places I manipulate arrays
[a,b,c] makes a row vector
[a;b;c] makes a column vector
[] is nothing - like declaring a 0-by-0 array that can have other arrays appended to it
array(:,2) returns the second column from the left of array (not the third like in C)
array(2,:) returns the second row from the top of array

Code: [Select]
xextent=eps;
eps is just a small number, 2.2204e-16, so that the area or volume (measure) can't be zero, which causes problems.

.* is element-wise multiplication, rather than matrix multiplication.

size(array) returns a vector which measures array (in numbers of rows and columns) - it's {number of rows, number of columns}, if array is only two-dimensional.

Sorry abut those (especially the bits that were redundant leftovers :(), hassle me about anything else I haven't made clear, by post or PM.

*EDIT: above, about the transpose.

12
Mods, Clones and other Fan Content / Re: That Ur-Quan Master #18
« on: March 01, 2010, 09:55:40 pm »
Maybe we should bet on how many appendages he'll have left by the end of volume 1 ;D

Did you know that spiders have transparent blood?  Neither did I, until I did research for this comic! 
I think that's your best preamble yet.

13
It might be worth noting that my approach to the MST is different to most others out there. Normally, one has a whole lot of ``weights" which in this context are the interpoint distances. There is a weight for every pair of points. So if one has 1000 points, the first step is often to calculate about half a million distances, and leave that array in memory while generating the MST.

I don't calculate all the weights first up because it isn't necessary, instead I search around each tree within a small radius for the closest points, and incrementally increase the search radius until it's sufficient to link all the points. I can't be sure it's faster than precomputing the weights to begin with, but the 1000 points in 3 dimensions takes about a minute on my computer, the way I've done it. Adding the links for the Zeracles graph is really cheap, possibly less than a second.

14
Off Topic / Re: The Pissed Off Megathread
« on: February 25, 2010, 05:12:10 pm »
It pisses me off that people still care whether we caused global warming or not. It's already happening, stop pointing fingers and start finding ways to ameliorate the problem.
Knowing which industrial pricks are most responsible would be quite practical; as our continents sink I would like to know who to throw overboard first.

I'm pissed off that snow. Again. Now. And I've bought a second hat. And it's going to get covered in snow.

HATE.
I once went to a school at which we wore straw boaters (like wearing a saucepan) that would partially dissolve when they got wet. Snow would have been bad. It would have pissed me off, in fact.

I hate having to close the store, go home and sleep for five hours, and then come back and open the store!
What about sleeping in the store? No shortage of bedtime reading!

I bike to work. What with the amazing snowstorms Sweden has been having, it's been a challenge. and this morning it was -22 C. It's only three kilometres or so, but it was still a bit chilly. Seeing my co-workers all warm after their car rides pissed me of. but then I chuckled as I realized they'll die of obesity long after I get run over on the roads...
I agree, dying of obesity would be a worse fate than getting run over, but I reckon it's more likely you'll freeze on the way.

15
Page 12 and we're still on the bike track? ;D

Thanks Dragon, if you're doing a conversion based on the code I posted, let me know if anything is confusing.

I wouldn't worry about increasing the friendliness and getting lines passing through points because in 3D is unlikely a line will pass *exactly* through a point.
Normally yes, but if one of the structures in the starmap is a thin ``wall" (like in an example I posted on the previous page), it becomes much more likely as then it's locally reduced to the planar case.

Pages: [1] 2 3 ... 29