Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AGP

Pages: 1 ... 3 4 [5] 6 7 ... 102
61
Support / Re: Painting a Mouse Cursor-Selected Polygon
« on: April 11, 2017, 07:47:16 pm »
The game is coming along nicely, but now I'm just abusing the CPU. From what I gather of what you wrote, I'm not going to have a problem with the mouse (the "if it should be applied to compiled objects, one would have to switch from individual textures..." comment was only about the painting of the polygon) in hardware. Right?

62
Support / Re: Rotation Towards 3D Point
« on: April 11, 2017, 07:41:22 pm »
It's normalized and it does frequently (say, 5% of the time) happen that the model get rotated 90 degrees on an axis other than the world's y.

63
Support / Re: PolygonManager.getTransformedVertex is Unreliable
« on: April 11, 2017, 07:39:14 pm »
It wasn't done on a thread other than the main thread.

64
Support / Re: Rotation Towards 3D Point
« on: March 10, 2017, 06:38:36 pm »
Update: sometimes the models are rotating in an axis other than the world's y. Is there  a way for me to limit the matrix's rotation to only the y axis?

65
Support / Re: Rotation Towards 3D Point
« on: March 10, 2017, 04:32:25 pm »
I wasn't being lazy, FYI. But after several attempts based on yours, this is what worked:

Code: [Select]
     public void rotateTowards(SimpleVector towards) {
SimpleVector target = new SimpleVector(towards);
        SimpleVector dir = target.calcSub(model.getTranslation());
        Matrix rotationMatrix = dir.getRotationMatrix(new SimpleVector(0, 1f, 0f));
rotationMatrix.rotateY((float)Math.PI*-.5f);
if (this instanceof Worker)
     ((Worker)this).setRotationMatrix(rotationMatrix);
else model.setRotationMatrix(rotationMatrix);
     }

66
Support / Re: Rotation Towards 3D Point
« on: March 10, 2017, 03:46:21 pm »
This is a language barrier. "Right side up" means "not upside down" (in this case, the model's up direction is aligned with jpct's world in that -y points up).

Your example works, but I should have clarified that the direction is stored in an array of ws SimpleVectors (as returned by the pathfinder), so your raycasting code won't apply. So how could I use it in this context?

67
Support / Re: Rotation Towards 3D Point
« on: March 09, 2017, 06:22:41 pm »
If the characters are on the x/z plane and right side up, should I not do

Code: [Select]
Matrix rotationMatrix = directionVector.getRotationMatrix(new SimpleVector(0f, -1f, 0f));?

Because that didn't work.

68
Support / Re: PolygonManager.getTransformedVertex is Unreliable
« on: March 08, 2017, 04:34:38 pm »
The product of getTransformedVertex() often didn't work. I re-wrote boardSpaceFromWorld by getting the transformed centers of all surounding planes, and now it works every time.

69
Support / Re: Rotation Towards 3D Point
« on: March 08, 2017, 04:28:37 pm »
Oh, it should be noted that I already have both vectors in worldspace (my plane consists of multiple smaller planes that collide with the raycast mouse then just give me their transformed center).

70
Support / Re: Rotation Towards 3D Point
« on: March 08, 2017, 04:25:39 pm »
Most of the time it rotates in the wrong direction, sometimes it doesn't rotate at all. My game is on the x/z plane, but which method takes an up vector?

71
Support / Rotation Towards 3D Point
« on: March 07, 2017, 09:10:49 pm »
The following isn't working. How come?

Code: [Select]
     public void rotateTowards(SimpleVector towards) {
SimpleVector directionVector = new SimpleVector(towards.x -model.getTransformedCenter().x, towards.y -model.getTransformedCenter().y, towards.z -model.getTransformedCenter().z).normalize();//WON'T WORK WITH OR WITHOUT NORMALIZE()
Matrix rotationMatrix = directionVector.getRotationMatrix();
if (this instanceof Worker)
     ((Worker)this).setRotationMatrix(rotationMatrix);
else model.setRotationMatrix(rotationMatrix);
     }

72
Support / Re: PolygonManager.getTransformedVertex is Unreliable
« on: March 03, 2017, 09:49:35 pm »
Might it be a child/parent thing? My planes get added as children of a dummy pivot and the pivot gets translated, not the individual planes themselves...

73
Support / Re: PolygonManager.getTransformedVertex is Unreliable
« on: February 24, 2017, 07:59:02 pm »
OK, I wrote circles around the event thread. The code is ugly as it stands and it's still not working. It's now being called by the game loop, which is in the main thread.

74
Support / Re: PolygonManager.getTransformedVertex is Unreliable
« on: February 24, 2017, 07:24:14 pm »
Ahh, it's probably being called in the event thread. ws is character.getTransformedCenter(). How would that hurt things?

75
Support / Re: PolygonManager.getTransformedVertex is Unreliable
« on: February 24, 2017, 06:30:10 pm »
Do you see any reason why my method shouldn't work?

Pages: 1 ... 3 4 [5] 6 7 ... 102