Jump to content


Member Since 08 Aug 2001
Offline Last Active Oct 15 2013 02:55 PM

Posts I've Made

In Topic: Learning Math really from scratch

18 September 2013 - 07:59 AM

You say you studied for grades in school. What is your goal this time, to study only enough maths so you can do the programming you're thinking of right now, or to actually gain that luscious deeper understanding and have a larger set of mathematical tools to choose from in the future?


The best way of learning depends of course on who you are, but having a printed book is hard to beat. As has been mentioned, there are loads of really nice free video lectures online as complementary material, have a look. And considering the level of English in your post, I'd say maths books at the level you're interested in shouldn't be a problem. As always, there's no magic book to open the doors for you, just grab whatever you can find at the local library and have fun. Search for natural science programs in high schools and universities and see in what order they teach maths and go by that. Keep programming and try to find ways to apply what you're learning, and eventually you'll do just that with linear algebra.


Also, don't skip too many parts, thinking they are not relevant to rotating a 3D object. Maths is wonderfully intertwined, and starting with a strong foundation, new things in maths will be "obvious" rather some something you need to cram or constantly look up (i.e. "the reason for this expression is this, so the answer to my question is that" vs "was it this or that, wikipedia help!").


That's what I did, and what I'd do again...

In Topic: Stupid noob questions regarding radius...

01 September 2013 - 06:47 AM

If I understand your problem correctly:

You want to generate a random point (x,y) for a player that owns the chunk of circle between 0deg-15deg and your circle radius is 1 unit...


Randomly generate a vector as a length of 0-1 and an angle between 0-15deg.

The end point of that vector will be

x = L * cos(angle)

y = L * sin(angle)


You need to watch the convention of the sin/cos function you are using with regards to degrees vs radians.


Note that this will create a higher density of points close to the center of the disc. If you'd prefer a uniform distribution of points in the xy-plane, either generate (x, y)-pairs until one point falls within the circular sector of the player of interest, or scale the points by sqrt(L):

x = sqrt(L) * cos(angle);
y = sqrt(L) * sin(angle);

Read up on polar integration for more info.

In Topic: reason i love my wife

01 March 2011 - 07:27 AM

To indulge the OP:
A good friend of mine started using Linux many years ago after having seen me tinker. He currently lives with his fiancee who plays the organ in a church and pretty much organizes any music (the choir, inviting "classical bands" some nights etc). They have at least 5 PCs or so (a media server, media player, one or two office computers and a laptop, he's a collector), all running Ubuntu (I think he is trying Arch on the laptop atm) during the day with the power horses dual booting to Windows for hefty games. Even though his fiancee is not a computer monster (she does what "normal people do" on computers), she really likes Ubuntu and have no issues or complaints about it. My good friend takes care of tech related issues anyway, and afaik that's a rather lazy "job". Wouldn't dare say this is the reason they love each other, but they both use Linux and they live a happy life together.

For the nervy people: She is really pretty too... And does not smell funny!

Aah, online communities, the metal grater back rub.

In Topic: Procedural Skys - A Different Approach

23 July 2008 - 09:13 PM

There are a few things you can do to compress the storage:
*) Non uniform zenith angle, use more detail at the horizon, can reduce # verts to at most 60-70.
*) Reuse color sets, use one "day color set" and one "night color set" for several hours, 8 color sets should suffice.
*) As joe_bubamara stated, you don't need 32 bits precision, or even 24 bits since you interpolate, you will get all possible colors anyway.
*) From the good old links by filousnt, skip azimuth dependence for color and modulate brightness.

Let's say you have a 12*5 skydome, 8 color sets, 16 bits of color precision and zenith only dependence. With all the above it'd take 5*8*2 bytes = 80 bytes. For the entire skydome, 12*5*8*2 bytes = 960 bytes. A couple of years ago I specified 4 angles for azimuth and interpolated between, 4*5*8*2 bytes = 320 bytes.

In Topic: Curve a line to reach desired distance fom its base?

01 July 2008 - 10:15 PM

In short, there's no explicit expression.