Image will not refresh in a camera scene
NickName:Paul Ask DateTime:2016-12-01T09:38:44

Image will not refresh in a camera scene

Image will not refresh in a scene. Using Javascript, Three and CSS3DRenderer on the client within chrome. I have an image embedded in a scene via a THREE.Object3D and when the image is updated on the server, the image will not update in the scene. I do use a cache breaking technique and proved to myself that the browser cache was being updated. In summary:

var camera = new THREE.PerspectiveCamera(40, window.innerWidth / window.innerHeight, 1, 10000); 

var scene = new THREE.Scene();

var renderer = new THREE.CSS3DRenderer();
var controls = new THREE.TrackballControls(camera, renderer.domElement);

var element = document.createElement('div');
var img = document.createElement('img');
img.src = images[i].src+'?t='+new Date().getTime(); // cache busting technique
element.appendChild(img);
var object = new THREE.CSS3DObject(element);
scene.add(object);

The image is displayed just fine. It is then updated on the server with the same cache busting technique and nothing changes in the scene. I’ve tried to update the scene with a variety of statements like:

scene.remove(x);
scene.add(x);
camera.updateProjectionMatrix(); // didn't do anything I noticed
renderer.render(scene, camera);  // 

Any clues would be helpful Thanks

Copyright Notice:Content Author:「Paul」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/40901239/image-will-not-refresh-in-a-camera-scene

More about “Image will not refresh in a camera scene” related questions

Image will not refresh in a camera scene

Image will not refresh in a scene. Using Javascript, Three and CSS3DRenderer on the client within chrome. I have an image embedded in a scene via a THREE.Object3D and when the image is updated on the

Show Detail

Refresh Android Emulator Camera

I am changing the default poster image in the emulator's virtual scene, but if I want the camera to refresh to the new image I have to close and open the camera app (if it is already open) But in A...

Show Detail

BabylonJs scene background image

I have quite new to BabylonJs and im currently Learning by doing. I am trying to insert an image as the background for my scene: However ive looked all over the internet and no where is it descr...

Show Detail

A-Frame camera vs three.js camera peformance on scene with large number of elements

The following code pen stress tests 3 scenarios: https://codepen.io/ubermario/pen/QqWQPa ... this.el.setObject3D(objName, cubeObj); //register to A-Frame; accessible with this.el.getObject3D(

Show Detail

Camera lags if i place more than 5 image targets in a single scene Unity vuforia

I am making an augmented reality app for android. I have 40 different target images and 40 different 3d models for each target image. I wants that when camera is ON user can locate any image target

Show Detail

Rotate camera around the scene

I would like to rotate my camera 90 degrees around the scene. I have tried using cosole.log(camera.position); and setting the camera to my desired position that I have seen in the log but this s...

Show Detail

VPython: Why do scene.camera.pos and scene.camera.axis never change?

I was experimenting in VPython with my scene's camera and I discovered that scene.camera.pos is always equal to <0, 0, 1.73205> and scene.camera.axis is always equal to <0, 0, -1.73205>.

Show Detail

Lighting of a scene with a moving camera

<html> <head> ... </head> <body> <script src="three.min.js"></script> <script>

Show Detail

How do I get Camera properties from a scene camera?

In order to get the camera, I can use bpy.data.objects["Camera"]. This returns a Camera object corresponding to the camera named Camera. However, when getting this camera from the scene, it

Show Detail

Calculate scene luminance using the back camera

I'm building an application on Android using a Samsung Galaxy Tab 10.1". I want to get the value of the scene luminance using the back camera of the device. Unfortunately I could not find a way to

Show Detail