|
|
On Mon, 01 Apr 2002 21:53:25 -0600, Xplo Eristotle wrote:
> Okay, this is driving me nuts. I have a bunch of 4 x .5 x 1 boxes which
> are stacked corner to corner in a stair pattern. Given their layout, I
> thought/assumed that they make a 30 degree angle with the ground (a
> plane), but when I added another box on the side and rotated it up 30
> degrees, it didn't line up with the blocks!
>
> I'm stumped. Barring some kind of bug, I can't imagine why I'm having
> this problem; the math isn't particularly complicated here. Can anyone
> help me with this? Code follows:
>
<snip>
> -Xplo
ok, one of you math geniuses can correct me if I'm wrong here, but I
think your problem is that the boxes do not form a 30 degree angle with
the ground...
taking a corss-section from the side view, you essentially are stacking
.5 x 1, and let's place the first one so the bottom left corner is at the
origin, like so:
|
|
| __
| | |
|__|__|
| |
| |
--------------------
ok, the upper right corner of the second box is at (1,2), which gives you
a triange with sides of length 1, 2, sqrt(5). Manipulating
the pythagorean theorem, you get something similar to the following:
1=sqrt((1/sqrt(5))^2+(2/sqrt(5))^2). So on the unit circle, you have an
x value of 1/sqrt(5), and a y value of 2/sqrt(5), and acos(1/sqrt(5)) is
approximately equal to 63.435. I haven't tried this in your code, so I'm
not sure if this will work, but I'm pretty sure I didn't make any
mistakes. Though, you never know at 3:30 in the morning. Hope this
helps!
--
David
smuchrusher <at> ameritech <dot> net
ICQ#: 118347772
3:10am up 4 days, 11:48, 4 users, load average: 3.80, 3.33, 3.11
Post a reply to this message
|
|