Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 11 May 2011
Offline Last Active Feb 26 2014 12:29 AM

Posts I've Made

In Topic: Simple hitTest with directions

17 May 2012 - 03:54 PM

It looks like you have it there without the complex if statements (I'm assuming A is the window and B is a box?).

if (left)
	return 1;
if (right)
	return 2;
if (up)
	return 3;
if (down)
	return 4;
	return 0;

Your booleans show whether one point is already pass another.

In Topic: Java engine (or something that works with Java)

16 May 2012 - 02:07 PM

If I've understood correctly, you might want to have a look at Processing. Very easy to use Java API for visuals. Many add-ins have been made for it (such as model importers) so I'm sure you would be able to suit it to your needs!

In Topic: animation errors

16 May 2012 - 12:51 PM

Almost identical? If you look for what you have done differently that could be your answer!

As far as I can see, what you got looks good... I haven't touched much graphics code in the last 6 months mind you! The only thing I would say that looks out of place is this:
if (x1 > windowWidth - rsize || x1 < -windowWidth)
	 xstep = -xstep;
-windowWidth (in a few places). As far as I'm aware, in OpenGL the origin is bottom left, so -windowWidth would be off the screen! I believe this should be 0.

Also it seems that the rect is initially being drawn off the screen with y - rsize: 0 - 25 = -25 which is below the window.

Hope this is helpful!