I'm using Proscene to handle some of the camera work for a rendering/video.
There's some issues with the camera rolling as I have it look left or right using Camera.lookAt().
Above is what it looks like. The object I'm following is near the x-axis, and when I turn the camera towards the center (the sun), the horizon (xy-axis) is tilted onto its side.
CAD_CAM does exactly what I'd like it to do, but it only applies to user interaction and not procedural/programmed camera work.
I can use scene.camera().setUpVector(new PVector(0,0,1)), but it's preventing pitching (rotate forward/backward) as well as rolling (rotate around forward-direction). I just want the XY axis to stay horizontal.
Camera.setViewDirection's description says: "
The Camera is rotated so that the horizon (defined by its upVector()) is preserved."
However, the xy-axis still rotates when I use it.
I've tried using setOrientation, but I'm admittedly not that familiar with Quaternions.
In summary: printMatrix() works fine with the P2D renderer, but I can't use getMatrix()
Hi. I'm trying to write a sprite class where I could load an image, and map screen coordinates to coordinates local to the sprite. For example, if I use push/pop matrix to rotate and translate the sprite to a certain part of a screen, and decide I want to draw a circle on the sprite with my mouse, I'll need to somehow take those coordinates, apply the rotations and translations that were applied to the sprite to those coordinates, and use them to edit the sprite's pixels array.
At the moment, I have a working version where I have a hashMap of screenX and screenY locations (with the index position in pixels[] for value) which I use to draw onto the sprite when needed. This hashMap gets updated every frame, or everytime the sprite changes positions. Unfortunately, this is too slow for me to put to good use.
So I'd like to do this a different way. Instead of storing the Sprite's real-world pixels in a hashMap, I'll just apply rotations/translations/scaling to the coordinates I'm using to edit the sprite. It'll be as simple as keeping track the applet's matrix at the time of the sprite's drawing, right?
I have one obstacle though. Processing (I'm using the P2D renderer) wont let me use the Matrix. Everytime I call getMatrix(), I get an error.
getMatrix(), or this particular variation of it, is not available with this renderer.
This confuses me though, because printMatrix() works just fine! Is this an error in P2D? Is it like this for a reason?
Perhaps I'm doing this completely wrong. I'm happy to take an advice regarding this. Thank you for your time.
but it isn't quite what I'm looking for. I want to be able to map the cursor coordinates to the floor, rather than draw on the screen then be able to rotate.
I'm having some problems with point() flickering when Processing has smooth() enabled (for all renderers). If I remember right, this can be fixed by converting x and y to integers instead of floats. However, this can't really be avoided when you're trying to use point() in 3D, because the rendered values, I suppose, are ending up as integers.
I can avoid this by using P3D with smooth disabled, but then points aren't clipped if they're behind the camera (this was actually my original problem). The only time I can clip points behind the camera using the renderer is using OpenGL, which causes those inconsistencies whether or not anti-aliasing is enabled. Which is where I'm stuck at.
So my question: is there any way I can plug in points, have them displayed consistently, and still have points behind the camera clipped?