Hi guys!
Recently i find myself another problem about the camera perfomance in threejs.
Sometimes i construct some meshes meant to be something solid like walls, foundations.
I use threejs box ,cylinder etc.
The thing is , camera may move inside those meshes.From inside , it looks absurd,well,cause it’s shouldnt be a hollow thing.Makes the whole thing looks really bad and cheap.
Is there a camera API so i can just set it to ‘true’?
So everytime when camera move close to something it’ll looks like we just about to collide with them instead of we straight bug into a building or something.
The Camera just defines the viewpoint into the scene, which could be anywhere. Materials and objects define what is visible from any given viewpoint. Mesh geometry is made of surface triangles, it isn’t really a “solid” thing, and once the camera is inside that becomes pretty obvious, so (at least in games) developers find ways to prevent the camera from getting into that position.
If you are providing camera controls you could either try to prevent the camera from going through objects by detecting collisions (physics engines like cannon.js can help with this). Or define “walkable” areas using something like three-pathfinding and clamp movement within those areas.
Ammo.wasm.js using c++, have workers, less lags.
Ammo: GitHub - kripken/ammo.js: Direct port of the Bullet physics engine to JavaScript using Emscripten<
Capsule player: Ammo.js with Three.js - #36 by yannick
The Capsule Player from the video is not implemented in the current version of enable3d. But it will be added in the next release
Thanks man!this is awosome
Much appreciate for the idea and practice tips!