2D Top Down Follow Camera Stuttering

I am making a top down pixel art game and am using a simple follow script for my camera.

void Update()     {         transform.position = new Vector3(target.transform.position.x, target.transform.position.y, transform.position.z);     } 

However i get this weird stuttering effect while moving around: https://gfycat.com/tintedlightheartedcrayfish

Any way to smooth out the camera movement?

Keep first person camera global rotation while the player rotates

I have a player with a camera set as its child. The script on the camera takes care of rotating the camera on the x axis while the script on the player rotates the player on the y axis (and the camera along with it). It works well, but I have a gravity system with planets and the player can change the center of gravity by clicking it (so its attracted to the object the player clicked).

The problem is that when I click on the object, the players rotates to relative to the new gravity center, and so does the camera. I wish that when my player rotates, the camera keep facing the same way. Here is what I mean.

Thats what happen when I chaneg the gravity center from the planet to the ground.

What happens when I change the gravity center

Here is what I would like to happen

What I want

I understand why that happens, but I don’t know how to fix it.

Here is the script on the camera:

 void Update() {             rotationY += Input.GetAxis("Mouse Y") * sensitivityY;     rotationY = Mathf.Clamp(rotationY, minimumY, maximumY);     transform.localEulerAngles = new Vector3(-rotationY, 0, 0); } 

Here is the script on the player managing the rotation around the gravity center + the Y rotation for the camera:

if (Physics.Raycast(rayStart, GetDirection(IsGrounded, GravityChangeHitPoint), out RaycastHit hit, Mathf.Infinity, layerMask))     {         Quaternion matchSurface;         if (GravityChangeHitPoint == GravityCenter.position)             matchSurface = PlayerLookRotation(transform.forward, hit.normal);         else             matchSurface = PlayerLookRotation(transform.forward, -GetDirection(IsGrounded, GravityChangeHitPoint));           Quaternion twist = Quaternion.Euler(0, Input.GetAxis("Mouse X") * sensitivityX, 0);         if (!IsGrounded)             transform.rotation = Quaternion.Lerp(transform.rotation, matchSurface, Time.deltaTime * damping) * twist;                      else             transform.rotation = matchSurface * twist;                  }   

PlayerLookRotation():

Quaternion PlayerLookRotation(Vector3 approximateForward, Vector3 exactUp) {     Quaternion zToUp = Quaternion.LookRotation(exactUp, -approximateForward);     Quaternion yToZ = Quaternion.Euler(90, 0, 0);      return zToUp * yToZ; } 

How to set up a network camera

How to set up a network camera
Network cameras (a.k.a IP cameras) are gaining popularity rapidly among consumers due to their ever-improving quality, features and declining prices. An HD network camera that normally cost over $300 in 2012 can be bought under $60 in 2021. Traditional typical users of network cameras are enterprises that have professionals for installation and maintenance. Many consumers choose the DIY approach to set up their cameras. This article is meant to help these users. It by no means can replace the help from professionals that is needed for a variety of reasons – complexity of a video surveillance system, user lacking required basic computer/network knowledge, demanded expedition…
There are literally thousands of models of network cameras in use. It is impossible to have a set of instructions fitting every model perfectly. We use a popular model (M1034-W) by the network camera inventor – Axis – in this article. The setup steps for the vast majority of other network cameras are either identical or very similar to the ones described here.
A word about ONVIF?. Detailed explanation about ONVIF is beyond the scope of this article. An average user may only need to know that ONVIF is an international standard. An ONVIF conformant camera offers the maximum compatibility and interoperability with many software and hardware on the market. Generally speaking, ONVIF conformant cameras have more features and better quality than traditional non-ONVIF network cameras.
You can find numerous ONVIF conformant models on any popular online stores such as Amazon or eBay
For this article, we assume the reader has very basic computer and network knowledge. Technically savvy users may find many parts are too rudimentary for them.
Network configuration
Network cameras are different from web cams and analog CCTV cameras. Web cams are connected to computers by USB cables. Analogy CCTV cameras are connected to servers by coax cables. Network cameras are connected to a network for access just like computers are connected to networks. Each network camera is actually a computer with a CPU and memory. I process images from CCD (Charge-coupled Device) or CMOS (Complementary Metal-oxide Semiconductor) sensors, send to clients (e.g. apps) and hosts a web server.
Configure Apps
Most users want to access their network cameras outside their LANs (e.g. outside their homes). The next section will explain how to access the cameras via Wide Area Network (WAN) (e.g. via cellular connections). Unless you are experienced with the camera and its configuration, it is extremely important to make sure the camera works on your LAN first. This is because the WAN access will never work if the LAN access does not work. If it works on your LAN, it will be very easy to diagnose any issues with the WAN access.
Many apps have automated the setup process to a great degree, and it usually takes less than 1 minute to set up a camera before starting enjoying its video.
The following is for setting up a camera with apps Onvier for Android, and IP CENTCOM for Windows 8.1/10 and Windows Phone.
What is a Video Codec?
A small article about how the video codec work and why this software is very important for the modern media industry.
Background: the idea for this article was born out of a discussion with my friends about media software: how it works and why it’s important. After that, I understood that what’s really needed is a short, simple article about it. So here I’ve explained why we need codecs and given an overview of how they work.
What is the Internet of Things?In the broadest sense, the term IoT encompasses everything connected to the internet, but it is increasingly being used to define objects that “talk” to each other. “Simply, the Internet of Things is made up of devices – from simple sensors to smartphones and wearables – connected together,” Matthew Evans, the IoT programme head at techUK, says.By combining these connected devices with automated systems, it is possible to “gather information, analyse it and create an action” to help someone with a particular task, or learn from a process. In reality, this ranges from smart mirrors to beacons in shops and beyond.”It’s about networks, it’s about devices, and it’s about data,” Caroline Gorski, the head of IoT at Digital Catapult explains. IoT allows devices on closed private internet connections to communicate with others and “the Internet of Things brings those networks together. It gives the opportunity for devices to communicate not only within close silos but across different networking types and creates a much more connected world.”Why do connected devices need to share data?An argument has been raised that only because something can be connected to the internet doesn’t mean it should be, but each device collects data for a specific purpose that may be useful to a buyer and impact the wider economy.Within industrial applications, sensors on product lines can increase efficiency and cut down on waste. One study estimates 35 per cent of US manufacturers are using data from smart sensors within their set-ups already. US firm Concrete Sensors has created a device that can be inserted into concrete to provide data on the material’s condition, for instance.Subscribe to WIRED”IoT offers us opportunity to be more efficient in how we do things, saving us time, money and often emissions in the process,” Evans says. It allows companies, governments and public authorities to re-think how they deliver services and produce goods.
“The quality and scope of the data across the Internet of Things generates an opportunity for much more contextualised and responsive interactions with devices to create a potential for change,” continued Gorski. It “doesn’t stop at a screen”.
The latest Internet of Things news
Where does the IoT go next?
Even those who have purchased one of the myriad smart home products – from lightbulbs, switches, to motion sensors – will attest to the fact IoT is in its infancy. Products don’t always easily connect to each other and there are significant security issues that need to be addressed.
A report from Samsung says the need to secure every connected device by 2020 is “critical”. The firm’s Open Economy document says “there is a very clear danger that technology is running ahead of the game”. The firm said more than 7.3 billion devices will need to be made secure by their manufacturers before 2020.
“We are looking at a future in which companies will indulge in digital Darwinism, using IoT, AI and machine learning to rapidly evolve in a way we’ve never seen before,” Brian Solis, from Altimeter Group, who helped on the research said.
IoT botnets, created using a network of out-of-date devices took large websites and services offline in 2016. A Chinese firm later recalled 4.3 million unsecured connected cameras. The ease of bringing down the internet using IoT devices was revealed when instead of malicious purposes, the botnet was revealed to have been created to game Minecraft.
But aren’t there privacy implications?
Everything that’s connected to the internet can be hacked, IoT products are no exception to this unwritten rule. Insecure IoT system led to toy manufacturer VTech losing videos and pictures of children using its connected devices.
There’s also the issue of surveillance. If every product becomes connected then there’s the potential for unbridled observation of users. If a connected fridge tracks food usage and consumption, takeaways could be targeted at hungry people who have no food. If a smartwatch can detect when you’re having sex, what is to stop people with that data using it against the watches’ wearer.
“In the future, intelligence services might use the [internet of things] for identification, surveillance, monitoring, location tracking, and targeting for recruitment, or to gain access to networks or user credentials,” James Clapper, the US direction or national intelligence said in 2016. Wikileaks later claimed the CIA has been developing security exploits for a connected Samsung TV.

What is Battery-powered 4G Camera?
The 4G camera is the mobile monitoring cameras that use 4G LTE network to deliver live-view and send instant alerts. (Similarly, 2g/3g security cameras refer to the ones that work with 2g/3g network)
As the above definition indicates, 4G cellular CCTV cameras require a separate mobile service plan to work. And the cellular data consumption of 4G IP cameras varies, depending on how often you watch live streaming and receive motion detection alarms, etc.
Reolink Go is one of the best choice for the newly-emerged 4G surveillance cameras.

How do I calculate Field of View and camera position from 2 images?

I am trying to re-construct the camera logic of RE4 that is applied when the player aims a gun.

I have attached a hack to RE4 which enables the user to change the camera’s FOV. Because of that I already know that the FOV for aiming with a gun is 50. The FOV during normal gameplay is 75.

I have then taken 2 screenshots:

  • Screenshot #1 shows normal / idle gameplay
  • Screenshot #2 shows aiming gun gameplay

These are the 2 screenshots. The red frame indicates the area that is still visible when the player aims. As one can see, the left side is heavily cropped while the right side is not cropped at all. This makes me wonder what the logic is here.

I have tried to replicate this behaviour, but I don’t manage to make my scene look exactely like that.

I would therefore like to ask if there is perhaps a mathematical approach that I can use to calculate the camera position offset that is being applied when the player aims his gun.

Thank you!

enter image description here

enter image description here

Cinemachine camera not working in Photon multiplayer system in Unity

I am fairly new to the whole multiplayer game mechanics, but I made a simple car controller and added cinemachine camera as a child to the car and then made it into a prefab, and I instantiate the car prefab in the game…..but every time I do that, the camera shifts to the other car…..

I’ve added all the important stuff like photon view and transform. I’ve also changed the script to check ‘if.mine’,

but still the camera shifts to the other second player while I control the first….

Can someone please help me to find a solution……

pseudo 3D camera turning html canvas javascript [closed]

I am trying to learn to make 3D games in JavaScript using HTML 2D canvas. I was following this post about it and I made a simple scene that you can move around in.

What I need help with is figuring out how to make the effect of the player turning their head, to look side to side and behind them.

Here is what I have:

Codepen link

Code (also on codepen)

html:

<html lang="en"> <head>     <meta charset="UTF-8">     <meta http-equiv="X-UA-Compatible" content="IE=edge">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>3d test</title> </head> <body>     <canvas id="canv"></canvas> </body> </html> 

javascript

//use arrow keys to move around  var canvas = document.getElementById("canv"); var c = canvas.getContext("2d");  canvas.width = canvas.height = 800;  var crateImg = new Image();  class Entity {     constructor(x, y, z, w, h) {         this.x = x;         this.y = y;         this.z = z;         this.w = w;         this.h = h;         this.rx = 0;         this.ry = 0;         this.rs = 0;     }     render() {         //c.fillStyle = 'red';         //c.fillRect(this.rx, this.ry, this.rs*this.w, this.rs*this.h);         c.drawImage(crateImg, this.rx, this.ry, this.rs*this.w, this.rs*this.h);     }     update() {         //project to 3d         this.rs = 400/(400+this.z);         this.rx = ((this.x*this.rs) + 400);         this.ry = (this.y*this.rs) + 400;           //move         this.x += camera.xSpeed;         this.y += camera.ySpeed;         this.z += camera.zSpeed;     } }  var camera = {     xSpeed: 0,     ySpeed: 0,     zSpeed: 0, }  var entities = [];  function random(min, max) {     return Math.floor(Math.random() * (max - min) + min); }  window.onload = function() {     start();     update(); }  function start() {     crateImg.src = "https://i.imgur.com/O9ForWS_d.webp?maxwidth=760&amp;fidelity=grand";     for(let i = 0; i < 100; i++) {         entities.push(new Entity(random(-800, 800), 0, i*10, 50, 50));     } }  function render() {     //fill background     c.fillStyle = 'skyblue';     c.fillRect(0, 0, 800, 800);     //draw flooor     c.fillStyle = 'green';     c.fillRect(0, 400, 800, 400);     //draw entities     for(let i = 0; i < entities.length; i++) {         if(entities[i].z > -400) {             entities[i].render();         }     } }  function update() {     //updatre entities     for(let i = 0; i < entities.length; i++) {         entities[i].update();     }     entities.sort(function(i, i2) {         return i2.z - i.z;     })     //redraw current frame     render();     requestAnimationFrame(update); }   function keyDown(e) {     switch(e.keyCode) {         case 39:             camera.xSpeed = -5;             break;         case 37:             camera.xSpeed = 5;             break;         case 38:             camera.zSpeed = -5;             break;         case 40:             camera.zSpeed = 5;             break;     } }  function keyUp(e) {     switch(e.keyCode) {         case 39:         case 37:             camera.xSpeed = 0;             break;         case 38:         case 40:             camera.zSpeed = 0;             break;     } }  document.onkeydown = keyDown; document.onkeyup = keyUp; ``` 

How to enable anti-aliasing when camera zoom in libgdx

I develop a game where I draw some textures on the screen and want to zoom in and out the scene. I am using OrthographicCamera and when I zoom in, the textures become very pixelated. Is it possible to enable anti-aliasing or is there another way to get zoomed textures without crisp edges?

enter image description here

My code is the following

public class DesktopLauncher {     public static void main (String[] arg) {         LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();         config.title = "Anti-aliasing";         config.width = 600;         config.height = 480;         new LwjglApplication(new MyGdxGame(), config);     } }  class MyGdxGame extends ApplicationAdapter {     SpriteBatch batch;     Texture img;     OrthographicCamera camera;          @Override     public void create () {         batch = new SpriteBatch();         img = new Texture("badlogic.jpg");         camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());         camera.setToOrtho(false);          camera.zoom = 0.1f; // this makes it all to look pixelated     }      @Override     public void render () {         ScreenUtils.clear(0.1f, 0.2f, 0.3f, 0.1f);         camera.update();         batch.setProjectionMatrix(camera.combined);         batch.begin();         batch.draw(img, 100, 100);         batch.end();     }          @Override     public void dispose () {         batch.dispose();         img.dispose();     } } 

How do I stop gyroscope-controlled camera from jittering when holding phone still?

I have here a simplified version of my gyro-controlled camera with a sensitivity modification (a side effect of increasing sensitivity is that the jitteriness is exacerbated).

public class GyroControl : MonoBehaviour{  private Transform _rawGyroRotation; Vector3 gyroAdjust; [SerializeField] private float _smoothing = 0.1f;  void Start() {     Input.gyro.enabled = true;     Application.targetFrameRate = 60;      _rawGyroRotation = new GameObject("GyroRaw").transform;     _rawGyroRotation.position = transform.position;     _rawGyroRotation.rotation = transform.rotation;  }  private void Update() {     _rawGyroRotation.rotation = Input.gyro.attitude;      gyroAdjust = _rawGyroRotation.rotation.eulerAngles * 2; //increase rotation sensitivity     transform.rotation = Quaternion.Euler(gyroAdjust);      transform.rotation = Quaternion.Slerp(transform.rotation, _rawGyroRotation.rotation, _smoothing);  }} 

When in motion, the jittering isn’t noticeable. But when you hold the phone still, there’s what I assume to be just analogue noise that causes jittering. I would really appreciate any help or advice on how to add a filter or something to reduce the jittering for this kind of controller.

Thanks.