Like the title says, I’m after some kind of constraint for the camera to prevent the player from seeing beyond the scene and seeing the Skybox. I came across the code to add a Mathf.Clamp, but I can’t get it to work. I’m currently trying to make a 2.5D platformer in which the camera follows the player (ahead), which leads to seeing beyond the scene to the far left and right. I already have an invisible wall in place to prevent the player from falling off, but I would love to also clamp the camera from going any further.
I am making a 3D space shooter game using OpenGL and Bullet Physics. I am having a hard time with the 3rd person Camera though. If you take a look at the video above you can see that the camera follows the spaceship rotating on the X axis without a problem and rotating on Z axis also without a problem when the spaceship is is oriented towards the horizon and parallel to the ground. When I roll to the right and move the spaceship up I am totally losing it from the camera. The code for my camera is as follows:
The above code is used to calculate the position and rotation of the camera. The commented out code was used to calculate the position based on trigonometrical calculations for the x and z sides of the triangle created from the camera position to the player position. This didn’t work right because I could never set the camera behind the spaceship, only the position worked well.
On the non-commented out code I use as a camera position the player position – back vector * offset. This works fine for the simple purpose that the camera is always on the back side of the spaceship. I also update pitch and roll which works almost fine and here is where I need help mostly to get this right. I also never update the yaw of the camera.
This is how I get yaw, pitch and roll from Bullet Physics rigid body of the player (spaceship):
and lastly how the view matrix of the camera is calculated:
// You should know the camera move reversely relative to the user input.
// That's the point of Graphics Camera
glm::quat reverseOrient = glm::conjugate(Orientation);
glm::mat4 rot = glm::mat4_cast(reverseOrient);
glm::mat4 translation = glm::translate(glm::mat4(1.0), -Position);
return rot * translation;
Can someone help me fix the rotational problems that I am facing? I am open to modify also the Camera Class to make it work better with Bullet’s quaternions instead of the Euler’s angles that I am trying to use. Any code or ideas are very welcomed. Thank you for reading through.
I use ADB to stream my phone screen to my laptop over USB. I would like to extend this method to stream the camera output to my laptop. To do that, I connect my phone over ADB, start screencast, and open the camera app. I get the camera output on my laptop with no issues, but I also see the on-screen buttons such as shutter, settings, gallery etc. I tried magnifying glass and mirror apps but all the apps I checked do have the controls. So, the question is – Is there a camera app for Android that does not show on-screen controls? Alternatively, is there a FOSS app that can stream camera output to laptop (preferably, Linux or Mac) over ADB? Thanks!
P.S.: I tried IP webcam applications but unlike ADB they all have significant delay.
Focal length does not change with sensor sizes – what actually changes is the field of view:
FOV (°) = 2 * arctan ( d (mm) / (2 * f (mm)) )
FOV is our field of view in degrees, d is one of the dimensions of the sensor (for diagonal, it is d = √(h² + w²) ) and f is the focal length in millimeters.
In very simple terms, a smaller sensors sees a smaller portion of the lens’s projection – e.g. a APS-C sensor does not fill out a 35mm lens’s image circle, so it cannot see the outer portions (which relate to the outer regions of the frame) and therefore, the field of view is narrower than it would be with a full frame camera.
When we talk about crop-factors, what we really are talking about is the change in field of view by a smaller sensor: The reference is a full frame sensor, which is 36*24mm. Therefore, a 10mm lens on an APS-C camera is still a 10mm lens – it just happens that it offers the same FOV as a 15mm lens would on a full frame camera.
The same of course is true for smartphones – unfortunately, the smartphone market is constantly and rapidly changing, and manufacturers usually do not state focal length or sensor size in their marketing texts, so research is needed on a per-phone-basis (or so I think).
A (at this moment) recent iPhone X offers an equivalent-to-28mm lens and an equivalent-to-52mm lens, the Samsung Galaxy S9+ offers 26/52mm, the OnePlus 6 offers 25mm, the Huawei P20 offers 27mm/80mm, the Nokia 6.1 offers 27mm,…
So it seems we can conclude that 26-28mm (equivalent) are a standard in Q3/2018.
My phone Nokia TA-1053 is almost stock android with a couple of apps from them here and there. I really dislike their camera app. So, I tried to install Google Camera(since all other apps are from Google).
Now Google Camera app is not available in Play Store(at least for my phone). So I tried to side-load it from Apkmirror. My phone’s android version in 9 and it supports API 28.
I downloaded the apk, installed it and when I was trying to open it, the app just won’t open. It instantly shuts down the app and shows error messages. What should I do?
I’ve been working on a 2D RPG game in Unity, and for some reason, whenever my character runs into a wall, the camera begins to shake violently. I have a RigidBody2D and a BoxCollider2D connected to him and a TilemapCollider connected to my Tilemap. The RigidBody component is Dynamic with a gravity scale of 0 (because it’s a top-down game). Also, the camera is a child of the player. Here’s the script to my character controller:
public class PlayerController : MonoBehaviour
// Variable for the player speed and animation
float speed = 2f;
private Animator animator;
private Vector3 change;
// Called before the first frame is loaded
// Gets animator component
animator = GetComponent<Animator>();
// Update is called once per frame
// Detects change in the player's coordinates
change = Vector2.zero;
change.x = Input.GetAxisRaw("Horizontal");
change.y = Input.GetAxisRaw("Vertical");
if (change != Vector3.zero)
// Detects whether the player's animation should play or not
// Allows movement on the X axis and calculations to allow the player to move
if (Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.RightArrow))
transform.Translate(Vector2.right * speed * Time.deltaTime);
if (Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.LeftArrow))
transform.Translate(-Vector2.right * speed * Time.deltaTime);
// Allows movement on the Y axis
if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.UpArrow))
transform.Translate(Vector2.up * speed * Time.deltaTime);
if (Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.DownArrow))
transform.Translate(-Vector2.up * speed * Time.deltaTime);
I have some Disc Film in the fridge that I would like to use, that I got from a film lot.
It seems unlikely that anything amazing will come out of it, but experimenting is part of my process and some recent results look really cool.
I found a lab that processes it, but I don’t own a Disc camera. They seem to cost a dime a dozen on second-hand marketplaces, however, I recall from using one in the past that the batteries are usually not removable by the user, to save space and make a thin camera (they are welded inside the body) – and therefore, batteries from this period might have ran out of juice or become damaged if I just bought any such model.
Given that over 30 different manufacturers made cameras that use disc film, I wonder if some of them were smart enough to design them to use regular, removable batteries.
These types of cameras are very under-documented across the internet.
Are there Disc film cameras that use regular removable batteries?
it seems I had a bad idea yesterday. I got a new SD card for my Fairphone 3+ (running Fairphone OS/Android 10). There was already an SD card inserted I assumed not to be in use. So I turned off the phone, exchanged the cards, booted the device and when asked to extend the phones memory I confirmed that.
Now I have two problems:
I’m missing a couple of pictures.
I wondered if these were on the old (luckily only 8GB) SD card and recognized that there are two partitions on it: android_meta and android_expand. As far as I learned, this means the SD card also was used as phone memory extension and thus encrypted. And the posts on Android Enthusiasts read like the phone has only one encryption key and won’t recognize the old SD card anymore.
The Camera can’t save pictures anymore.
Whenever I take a photo I’m able to immediately open it by tapping its preview. Then I see a black picture, I’m told its size is 0 bytes and it’s located in /storage/emulated/0/DCIM/Camera. Using the cx File Explorer I’m able to open that directory, but it’s empty. And I’m not able to create files there.
Using the ADB shell I was able to ls -la /storage the directory and got this:
In modern digital cameras there are many settings which are applied automatically to the photos. And it does not always result in good ways. Recently I saw two photos of the same face one from a old analogue camera and the other a digital one.
The photos were considerably different and the one from analogue was much more close to the real face in every aspect.
So this is my question as I am not a pro in camera market:
Is there any model of digital cameras in the market in 2021 that takes photo like analogue cameras without manipulation and artificial improvements?