www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: AGP on October 28, 2011, 11:06:44 pm

Title: Re: Ortho Rendering part 2
Post by: AGP on October 28, 2011, 11:06:44 pm
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:
Code: [Select]
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);
Title: Re: Ortho Rendering part 2
Post by: EgonOlsen on October 28, 2011, 11:44:48 pm
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() (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.

Title: Re: Ortho Rendering part 2
Post by: AGP on October 28, 2011, 11:48:45 pm
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).
Title: Re: Ortho Rendering part 2
Post by: AGP on October 29, 2011, 12:22:47 am
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.
Title: Re: Ortho Rendering part 2
Post by: EgonOlsen on October 29, 2011, 05:18:44 pm
No problem.