New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Primitives #128
Primitives #128
Conversation
I just noticed something: The orientation of the created object is not affected at all by which way you draw it. The calculations always produce the exact same outcome (except for the @peastman: Has it been the original intention to change the orientation of the object by how you draw? I believe it has been for a long time as it is now and this would be at least my expectation as a user. Either which way, I'll rewrite this PR. Also 'expand from center' function might be a nice addition. Possibly holding ctrl down? Lights have a different function for ctrl-drag but would that be a problem? Edit: Typos patched. |
When you say "which way you draw it," do you mean which corner you start dragging from? Yes, that shouldn't make a difference. |
.. And so the case is the latter one. :) |
Ok, I think I'm done with this one. It went a bit further than just fixing the occasional views going blank. As it turned out the calculation, that caused that had no other effect than the occasional uncaught /0 error. The changes are not very visible but:
|
@i said earlier
But to be exact I ended up with: ydir.set(cam.getCameraCoordinates().getUpDirection());
zdir.set(cam.getCameraCoordinates().getZDirection());
zdir.scale(-1.0); Y does not need any calculations and z only it's elements' signs flipped. This does not produce new vectors thrown to garbage. In CreatePolygonTool, there is: ydir = cam.getViewToWorld().timesDirection(Vec3.vy());
zdir = cam.getViewToWorld().timesDirection(new Vec3(0.0, 0.0, -1.0)); Logically the result is exactly the same but (in the Polygon tool) with a longer route to calculate it: When the user rotates the view, the conversion matrix is recalculated based on the position and orientation of the Camera. What happens, when you throw a [0,1,0] into the machine is that, the information travels to the opposite direction and the result actually is the Y-direction of the Camera.... Can anyone find something wrong with this thinking? |
Resolves #126
Creating primitives with a 0 for a dimension is still possible, but it will not break the ObjectInfo. Property dialogs and pose keyframe editors can handle 0-dimensions too.
Using undo at creation time to prevent creating entirely flat objects would not have worked as the undo would still be redoable.