Monday, 29 June 2009
Oh my GG.COM!
What happened to BLProductions' layout?? Well, apparently Google Pages is moving, therefore, the files hosted there will disappear. So, to avoid any unpleasant background picture, I reverted back to the old layout. Kinda disappointing, actually. I need to find sometime to go look for a permanent webhost which can host files for me.
Sunday, 28 June 2009
3D Studio Max! Whee!
Finally, my wish came true! I got my 3D Studio Max! I can finally scrap that Blender3D! It looks easier to model in 3D Studio Max compared to Blender3D. The tutorials provided are quite detailed. Ahh...
Well, I tried modelling a chess piece, namely, the Pawn.
Well, I know, it looks weird, but that's a start! I pwn man! Hahahaha! I crack myself up!
Well, I tried modelling a chess piece, namely, the Pawn.
Well, I know, it looks weird, but that's a start! I pwn man! Hahahaha! I crack myself up!
Friday, 26 June 2009
Sports Day!
Ahh! Today was quite a satisfying day! Good things happened! Scouts won 2nd place for marching! Did I mention scouts rock? Hahaha.
And and, Blue house won second place overall! Congrats to blue house!
Tomorrow, Saturday... gah! Replacement school. What the hell? Well, I shall be a good boy and attend the class. =D
Currently, I haven't continued Mr Ball 2. I'm a little busy with school stuff, especially Interact Club stuff. Installation Day is coming, so I have a lot of letters to type, as soon as Mr. Zol approves the Installation Day.
And and, Blue house won second place overall! Congrats to blue house!
Tomorrow, Saturday... gah! Replacement school. What the hell? Well, I shall be a good boy and attend the class. =D
Currently, I haven't continued Mr Ball 2. I'm a little busy with school stuff, especially Interact Club stuff. Installation Day is coming, so I have a lot of letters to type, as soon as Mr. Zol approves the Installation Day.
Monday, 22 June 2009
Is it the past?
It may not be obvious, but what you are seeing is actually the past. What the? Who the? How the?
I know, it sounds incredibly weird. How can what we are currently seeing be the past, when it's clearly the present? Ok, I don't even understand what that means.
We all know that light travels around 300,000,000m/s in vacuum right? That is very fast, I mean, REALLY FAST! Anyway, when light travels through a non-opaque medium like air, it slows down. It's not very hard to understand why that happens.
Supposed that you are a light particle, a photon! Let's assume the empty LRT station be the vacuum of space. Don't you think it is easy to run around the station?
Now, imagine it is rush hour, and suddenly, the whole place is filled with smelly and fat people. Each person is like a molecule in the non-opaque matter which I mentioned above. I mean, there are so many people, it's so hard to move around, so you slow down. Likewise, light travels slower in a denser medium.
Well, anyway, back to the matter at hand. Why did I say that what ever you are currently looking at is the past? Like I said, light need to travel to your eye before you can actually see.
Assuming the distance between your eyes and the monitor of the screen is 30cm. Speed of light=300,000,000m/s. If you work it out using the Speed=Distance/Time formula, you'll find that time=1 nanosecond.
So, what you are seeing on the screen now happened 1 nanosecond ago! But 1 nanosecond is so tiny, you won't be able to notice it. Cool right?
Oh, this will be even cooler if you could see a delayed reflection of yourself on the mirror. Let's say you are standing in front of a mirror, then you move your arm. 1 second later, you'll notice that your image moves his arm. To actually see this delay, you'll have to be standing 300000km away from the mirror.
Light, isn't it cool?
I know, it sounds incredibly weird. How can what we are currently seeing be the past, when it's clearly the present? Ok, I don't even understand what that means.
We all know that light travels around 300,000,000m/s in vacuum right? That is very fast, I mean, REALLY FAST! Anyway, when light travels through a non-opaque medium like air, it slows down. It's not very hard to understand why that happens.
Supposed that you are a light particle, a photon! Let's assume the empty LRT station be the vacuum of space. Don't you think it is easy to run around the station?
Now, imagine it is rush hour, and suddenly, the whole place is filled with smelly and fat people. Each person is like a molecule in the non-opaque matter which I mentioned above. I mean, there are so many people, it's so hard to move around, so you slow down. Likewise, light travels slower in a denser medium.
Well, anyway, back to the matter at hand. Why did I say that what ever you are currently looking at is the past? Like I said, light need to travel to your eye before you can actually see.
Assuming the distance between your eyes and the monitor of the screen is 30cm. Speed of light=300,000,000m/s. If you work it out using the Speed=Distance/Time formula, you'll find that time=1 nanosecond.
So, what you are seeing on the screen now happened 1 nanosecond ago! But 1 nanosecond is so tiny, you won't be able to notice it. Cool right?
Oh, this will be even cooler if you could see a delayed reflection of yourself on the mirror. Let's say you are standing in front of a mirror, then you move your arm. 1 second later, you'll notice that your image moves his arm. To actually see this delay, you'll have to be standing 300000km away from the mirror.
Light, isn't it cool?
Friday, 19 June 2009
WTF?
Hmm... I never knew there was a 3D Game Engine made for Game Maker. If I only knew earlier, I wouldn't have depended on Game Maker's 3D engine, just because it sux! ...
Well, maybe Mr Ball 3 will be built using Ultimate3D engine for Game Maker. It's really good as it eliminates the z-buffer transparency problem, well, at least I think it does.
Hmm... I don think I will even call it Mr Ball 3 by then, probably some other name but it is still Mr Ball. I really wish that in the third installment, it will have a storyline.
Well, maybe Mr Ball 3 will be built using Ultimate3D engine for Game Maker. It's really good as it eliminates the z-buffer transparency problem, well, at least I think it does.
Hmm... I don think I will even call it Mr Ball 3 by then, probably some other name but it is still Mr Ball. I really wish that in the third installment, it will have a storyline.
Wednesday, 17 June 2009
I got sacked, and then rehired!
I'm officially the Secretary of Interact Club of SMKTS. Ahh! I feel so proud saying that! lol! But, this is not a joking matter, as I can see a lot of stress and challenges ahead.
I hope I will be a great secretary, though, to do that, I have to kick my habit of procrastinating.
And I've been offered to join the 3D Games design competition with Gavin. Hmm... I must quickly start learning how to use C++. But I think Game Maker is still sufficient, but the graphics in Game Maker is quite limited.
Hmm... I only got like one month to finish my game. This could be hard. Sigh...
I hope I will be a great secretary, though, to do that, I have to kick my habit of procrastinating.
And I've been offered to join the 3D Games design competition with Gavin. Hmm... I must quickly start learning how to use C++. But I think Game Maker is still sufficient, but the graphics in Game Maker is quite limited.
Hmm... I only got like one month to finish my game. This could be hard. Sigh...
Monday, 15 June 2009
Run a line through
I shall pick up where I left off in my previous post...
Right, in my previous post, it was about Billboarding, one of the techniques used in 3D Games. Professional games use this technique so well, it's very hard to tell whether they are using 3D models or just plane rectangles!
There are advantages. One very important advantage is that it reduces polygon count. If you burden the video card with too many things to draw on the screen, the game will lag. So, for very complicated objects, it's better to use billboard.
But when there are advantages, there should be disadvantages. Though you can draw a lot of details on a billboard, it's quite limited. What do I mean by this?
Imagine you want to draw a 3D object on a billboard. So you draw an image of a sphere as a texture for the billboard. As the billboard turns around to face your camera (your eye), it shouldn't be too much of a problem, since spheres are round however you see them.
But let's say you drew an image of a cube as a texture for the billboard. As the billboard turns around, the same image of the cube keep on facing towards you. It's as if the the cube is turning around to face you with the same... err... face! That'll look weird, unless you intended to do that.
Still billboards are very cool!
Hmm... let's get on with Axial Billboards (or Axis-aligned billboards). Axial Billboards can still turn around to face the camera, but they can only rotate around an arbitrary axis.
Assuming Z is up on the Cartesian coordinate system, if the billboard is aligned with the Z-axis, it's very simple to rotate it and face the camera. All you've got to do is get the horizontal direction from the billboard to the camera.
Using my previous diagram:
Point A is the position of the billboard object, B is the camera. All you've got to do is solve for angle y. Angle x is not needed.

Then draw a quad the same way as shown in the previous post, but this time, the transformations are as follows:
-Rotate around z-axis at "y" angle
-Translate to object's position
That is only for Billboards aligned with the Z-Axis.
For a billboard with an axis that is aligned with the x-y plane (horizontal axis), there are a few more steps in the calculations.

Oh my! WTF??
Chill, relax, sip some coffee. All will be revealed in a moment.
Line AC defines the axis for the billboard. So, r is the angle of point C from A.
Before I continue, I should tell you that because Line AC is parallel to the x-y plane,
Getting r could not be any more easier! Just a little trigonometry and...
Now, what about q? q is a little tricky. To solve it, we need to know the direction of B from A on the x-y plane. Then, subtract it from r.

So,
Since we have q, we can now solve for d.

Oh, we're almost there. We just need to solve for h before we can get angle p.
h is simply the difference of z value between A and B.
Now, using tan,
Finally, that horrible p!
Now, draw the quadrilateral:

Transform it as follows:
-Rotate it around x-axis at -p angle
-Rotate it around z-axis at r angle
-Translate it to its position.
Now, I may be wrong with the rotation around the x-axis. I get confused easily with the negative and positive angles, so if you find that I made a mistake, do tell me.
And that's that! But this only applies to axes that are aligned horizontally (parallel to the x-y plane, assuming z is up).
Gosh, such wonderful maths. Now, don't you think 3D games are cool? You better do!
Billboards are best used when the camera is not too close. Otherwise, its secrets will be revealed to the player. Well, it's not that bad, but it won't look too pretty.
Here, you can see the laser beam in Mr Ball 2:


It's an axial billboard!
Now over here, you can see how the beauty of billboards can be ruined:
The billboard passing over an object will reveal its "flatness", most of the time
Oh, and this one. Seeing the end of the billboard just kills the illusion, doesn't it?
Well, that's all! Lol!
Right, in my previous post, it was about Billboarding, one of the techniques used in 3D Games. Professional games use this technique so well, it's very hard to tell whether they are using 3D models or just plane rectangles!
There are advantages. One very important advantage is that it reduces polygon count. If you burden the video card with too many things to draw on the screen, the game will lag. So, for very complicated objects, it's better to use billboard.
But when there are advantages, there should be disadvantages. Though you can draw a lot of details on a billboard, it's quite limited. What do I mean by this?
Imagine you want to draw a 3D object on a billboard. So you draw an image of a sphere as a texture for the billboard. As the billboard turns around to face your camera (your eye), it shouldn't be too much of a problem, since spheres are round however you see them.
But let's say you drew an image of a cube as a texture for the billboard. As the billboard turns around, the same image of the cube keep on facing towards you. It's as if the the cube is turning around to face you with the same... err... face! That'll look weird, unless you intended to do that.
Still billboards are very cool!
Hmm... let's get on with Axial Billboards (or Axis-aligned billboards). Axial Billboards can still turn around to face the camera, but they can only rotate around an arbitrary axis.
Assuming Z is up on the Cartesian coordinate system, if the billboard is aligned with the Z-axis, it's very simple to rotate it and face the camera. All you've got to do is get the horizontal direction from the billboard to the camera.
Using my previous diagram:
Point A is the position of the billboard object, B is the camera. All you've got to do is solve for angle y. Angle x is not needed.Then draw a quad the same way as shown in the previous post, but this time, the transformations are as follows:
-Rotate around z-axis at "y" angle
-Translate to object's position
That is only for Billboards aligned with the Z-Axis.
For a billboard with an axis that is aligned with the x-y plane (horizontal axis), there are a few more steps in the calculations.

Oh my! WTF??
Chill, relax, sip some coffee. All will be revealed in a moment.
Line AC defines the axis for the billboard. So, r is the angle of point C from A.
Before I continue, I should tell you that because Line AC is parallel to the x-y plane,
So,
Oh, we're almost there. We just need to solve for h before we can get angle p.
h is simply the difference of z value between A and B.
Now, draw the quadrilateral:

Transform it as follows:
-Rotate it around x-axis at -p angle
-Rotate it around z-axis at r angle
-Translate it to its position.
Now, I may be wrong with the rotation around the x-axis. I get confused easily with the negative and positive angles, so if you find that I made a mistake, do tell me.
And that's that! But this only applies to axes that are aligned horizontally (parallel to the x-y plane, assuming z is up).
Gosh, such wonderful maths. Now, don't you think 3D games are cool? You better do!
Billboards are best used when the camera is not too close. Otherwise, its secrets will be revealed to the player. Well, it's not that bad, but it won't look too pretty.
Here, you can see the laser beam in Mr Ball 2:


It's an axial billboard!
Now over here, you can see how the beauty of billboards can be ruined:
The billboard passing over an object will reveal its "flatness", most of the time
Oh, and this one. Seeing the end of the billboard just kills the illusion, doesn't it?Well, that's all! Lol!
Labels:
math
Subscribe to:
Posts (Atom)