Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 15 May 2012
Offline Last Active May 05 2016 08:53 AM

Posts I've Made

In Topic: Moving a shadow for a rotating object at an angle for 2D

03 November 2015 - 07:01 AM

The shadow itself should be drawn with a circle and not a square. Not only will it be more realistic, it'll also be easier to code this up. Now for the placement:


The two extremes from which the scene can be viewed are

  1. Top view i.e. the path of revolution is a perfect circle
  2. Front view i.e. the path of revolution is a horizontal straight line

If you get the shadow for these two angles right, then the remaining, intermediate angle views may be obtained by interpolating between these extremes. For the top view, the shadow circle will always be on the "far" side of the planet, quite simple. The front view, however, isn't as simple. The planet will be in the horizontal line's midpoint twice, once the shadow circle should be completely invisible (or rather behind the planet), while the other time it should obscure the planet altogether. When it hits the endpoints of the line, it'll be the same as the top view. This will mean changing the z-order of the rendering based on the planet's to or fro movement. While it's doing the first half of the circle, arc1, shadow should be drawn first and when in arc2, the shadow should be drawn second.


Hope these pointers help.

In Topic: best math learning source for game programers in all fields(ai, graphics ..)

27 October 2015 - 03:55 AM

Essential Math by Van Verth. Best one by far. Probably the only book you'll need.





I second that.


If you want a slightly more approachable (funny/intuitive) alternative, I suggest:

3D Math Primer by Fletcher Dunn and Ian Parberry


If you want something reference style, more rigorous (harder) with wider array of topics covered, I suggest:

Mathematics for 3D Game Programming and Computer Graphics by Eric Leyngel


I've read all three books. Each one is very good in treating some topic or the other. All are excellent in their own right.

In Topic: Disassembly and assembly links

14 July 2015 - 03:43 AM

An older Wayback machine snapshot had the images. I rsync'd the complete tutorial (12 parts with text and images); made an offline archive stripping off irrelevant parts.


The last two parts has sample code that could be downloaded but I couldn't recover them. Asked the author, he too didn't have backups, but for all the other parts the code is part of the tutorial/image, no a separate downloads, so it isn't much we're missing.


The download link, with the author's permission.

In Topic: When/where does handedness really matter?

12 March 2013 - 07:38 PM

Never. In both cases the vector mathematics is the same. The only difference is that in a right handed system it will be on the right hand side of the origin, and in a left handed system it will be on the other side.

Oh good, because this is exactly what I was thinking when I revisited cross product definition; although handedness decides the direction of the resultant of the cross when it boils down to math, the formulas don't change, numbers are still numbers, the resulting numbers would be the same; it's humans who interpret it based on the coordinate system handedness based on our liking.

Now, if you happen to be using either system, and introduce a scaling of -1 in one of the axes, then your coordinate-frame will now be the opposite handedness to your coordinate-system. I suspect that's what the author of the book was attempting to explain.

Yeah, in the reference of one system, when a new one is introduced via mirroring then this test would help.


In Topic: When/where does handedness really matter?

12 March 2013 - 01:16 PM

I'm now clear of the part that a model/asset by itself isn't explicitly left or right handed while to see it exactly the way its creator expected it to be seen, we need to interpret in that system.

However, I'm reading "Essential Mathematics for Game Programmers", in which there is a statement which goes, "when we've three basis vectors i, j and k, performing scalar triple product like (i x j) . k > 0 then it is right handed while if it's negative it's left handed".

What confuses me is, I took 3 vectors say 1i, 3j, 4k and drew them both in a left and right handed system, perform the aforementioned scalar triple product, I always get 12, which is positive, when would this be negative to show that the basis is left handed?