Hello, I have been a photographer for more than 2 years. I got tired of trying to figure out camera frustum settings, so I created my own library for setting the camera with actual camera sensor sizes and lenses.
These two topics got me started:
I have created a demo, originally to show off to my class, but why not showcase it on the forum as well!
This is great! I’m going to show this to someone who has been into photography for decades (as well as a programmer for decades). Going to see if this will be useful for my project, thanks!
It would be nice, as @nehon said to get it up on github or something similar.
Hum. I tried to implement this library and I did everything above. My scene became invisible. I’m using the same town model. I don’t know what am I doing wrong.
But I noticed something: in the example above, when you initialize the CameraAppState, you give the lens object to the constructor. However, I can only add a Lens object, not a LensDef object. So, I simply created a Lens object and in the construtor I put the lensDef object. Is this the problem?
I forgot to add that you call create () on the LensDef.
You may also want to turn on auto focus on the lens object, otherwise I can’t tell what you are doing wrong. Take a look at the source for the demo to see how I did it.
I did what you said, but still doesn’t work. I have the setCanAutoFocus method to true. So, I decided to download the demo source, but for some reason it’s in .tmp extension and it doesn’t have size! I guess it’s a problem from Google Drive?
…I just tied downloading it and I had the same issue, I think it’s to do with 7zip and drive. I can’t test the code but I have uploaded the source I am working on right now for you along with the current library source
Don’t worry, I will be using this library for a long time so I most definitely won’t.
I will upload to the github repository I created once I get home and am able to test the source!
EDIT: I will post the github repository in a new thread if that is ok, along with better explanations on how to use
I’ve been using my “physical camera” system for a long time now, you can see some of its interface briefly in this video: https://youtu.be/obnTpQ8JtZk?t=3m26s .
I’ve never released the source but am happy to try and help out if you have any questions regarding more advanced / realistic camera systems =)
Thanks for offering to help! Right now I have been working on creating a version of CameraNode that implements my library and also detects collisions with the scene.
Right now I have bounding sphere around the camera with a specified radius and have written the code for sensing collisions, but I need to figure out how to reposition the camera when it collides, do you think you could help?
The specific source files are PCameraControl and PCameraNode
Where I sense collisions is in the updatePosition() method of the control
Btw, that game looks amazing! Is that jme or a different engine?
I do understand what some of the camera values in your interface might do, I use a depth of field filter that has similar variables (I didn’t write the shader however, I only modified it for use in jme)