Re: Ortho Rendering part 2

Started by AGP, October 28, 2011, 11:06:44 PM

Previous topic - Next topic

AGP

On a not completely unrelated note, cloneObject() is cloning the object just fine (I can add the new one without getting the "already added" message), but when I try to translate it, it doesn't move. The docs say both objects would share the same mesh data, but I don't think that would be a problem. The following code is printing non-zero values for x and y, but isn't moving the cloned plane:

SimpleVector buildingCenter = currentlyBuilding.unitPlane.getTransformedCenter();
SimpleVector center3d = workerStandsWalksDies.getTransformedCenter();
SimpleVector destination = new SimpleVector(center3d.x-buildingCenter.x, center3d.y-buildingCenter.y, 0);
currentlyBuilding.unitPlane.build();
System.out.println("Translated? "+destination);
currentlyBuilding.unitPlane.translate(destination);

EgonOlsen

I've splitted this from the other thread, because i don't think that it's related. Back to the topic: I don't see why this should happen nor have i ever experienced anything like this nor do i think that this makes any kind of sense. The only thing i can imagine is that you are using lazy transformations (http://www.jpct.net/doc/com/threed/jpct/Object3D.html#enableLazyTransformations()). Are you? If yes, then try to disable it and see if that helps. If you don't use it, please double check your code. If it seems fine, i need a test case to verify this.


AGP

OK, I'll send you one. But the code really is being executed and no translation is taking place (for instance, if I println center3d.x-buildingCenter.x after the call to translate, the value is still non-zero).

AGP

I was using lazy transformations, sorry. I had even ocurred to me, but I just didn't think I was. Thanks and sorry for wasting your time.

EgonOlsen