Main Menu
Menu

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.

Show posts Menu

Messages - AGP

#1441
Forward, before any rotation, obviously, is +y. But the ship's rotation around z is precisely what shouldn't change in the new matrix.
#1442
Thanks a lot for the help. My world is on an x/y plane, with +z going up. And about the m.set methods, would I afterwards just add m.invert()?
#1443
And Egon, I wouldn't know what to search for. I found this: http://www.jpct.net/forum2/index.php/topic,1191.0.html, but I'm not sure I get it or whether it's what I'm looking for. I'm sure I sound like an idiot but I really only started taking a course on 3d graphics programming (it was c opengl). I loved, but I didn't get to finish it and I'm sort of new to this matrix stuff (first one I used was yours on the racer).
#1444
I don't care about the distance between the ship and the plane, I just want the ship to fly parallel to the plane itself (which is the ground). And thanks for the help.
#1445
As for getting them, wouldn't I just use the Matrix.get_Axis() methods? What about setting them?
#1446
So, Egon, is it possible to get a Matrix with the z rotation of one object and the x and y rotations of another?
#1447
I see your point, Paul (may I safely assume it's not your code that's writing me? :-), but what I meant is that I need to reset the ship's rotation on two axis only. In this case, I need to reset the ship's x and y, since I'm once again working on the x/y plane and all I want is for the ship to level (as opposed to leveling and facing in a different direction relative to the plane).

Which brings me to a suggestion, Egon: since you already implemented the config.oldStyle3DS boolean, why not change the new style loader to rotate all the models into jpct's x/z plane? And everyone who, like me, has worked with the x/y will just set the boolean to true whereas everyone else will no longer have to worry about this issue.
#1448
OK. Here's another question: what if I wanted to align only two out of the three axis? How could I get a Matrix whose z is the ship's rotation matrix's z and whose x and y are the plane's? I know I can get the axis with the get_Axis() methods, but there are no equivalent set() ones.
#1449
I flipped the matrices between plane and ship (lastRotation=ship.getRotationMatrix(), softMatrix=plane.getRotationMatrix()) after re-reading the documentation. It seems to work now, except that it's never finished in the ten iterations (if I call level() multiple times it eventually completes). How do I make it complete in 10 iterations?
#1450
Support / ship.align(plane) IN MULTIPLE ITERATIONS
July 20, 2009, 07:23:03 PM
I'm trying to achieve the equivalent of ship.align(plane) (leveling the ship) in multiple iterations. This is what I have. What I'm getting instead is the exact same thing as ship.align(plane): it aligns the ship to the plane in a single pass. Shouldn't lastRotation.interpolate(Matrix, Matrix, .1f) take care of only rotating 10%?


if (shipLeveling == 10) {
      lastRotation = plane.getRotationMatrix();
      shipLeveling = 0;
}

Matrix softMatrix = ship.getRotationMatrix();
lastRotation.interpolate(lastRotation, softMatrix, 0.1f);// interpolate between the matrices
Matrix matrix = new Matrix(lastRotation);
ship.setRotationMatrix(matrix);
shipLeveling++;
#1451
Yeah, I knew I didn't remember the Ascii perfectly. Thanks for your suggestion, I will do that.

Egon, the follow-up to my unanswered question: would it be possible to make a Object3D.compile(float lightMul)?
#1452
And yet another question (you're a very patient man!): World.getSize() is returning 14, but a loop that calls getObject(index) is returning every single reference as null (and jPCT prints out "Can't retrieve object #" for each). How come?
#1453
Cool, thank you. Here's a question about compiled objects: why do they use lightMul at 1.0 when the default lightMul is 10? Is there a reason for this decision (was it a decision or a necessity)? Because every time we choose to compile the objects (and I just ran into a performance issue that compile() solves nicely) we'll have to reconfigure all of our lights.
#1454
I sometimes lack the ability (physically, really) to fine-comb my own code. Now here's a brand-new question (!): what's the more efficient way to draw an animation on a plane than the one I'm doing (replacing the Texture instances on the fly)?
#1455
Jesus, I meant it to be 0. What an idiot I can be. Thanks a lot, pal.