there is option to walk camera horizontally \ how to do it?
i did rectStartin and rectClosin \ find Vector between
it \ walkin through diagonal
if (keys["e"]) {
camera.position.add(fromPassd.sub(fromClosin).mulitplyScalar(-1).normalize() );
}
if (keys["q"]) {
camera.position.sub(fromPassd.sub(fromClosin).mulitplyScalar(-1).normalize());
}
@Lawrence3DPK
I think it related with camera type, they expectd to have camera that combine both radial and horizontal walk
do you mean sidestepping? have a look at the logic in this character controls example, it’s difficult to understand what you mean exactly but if this example performs to your expectations I could help walk you through the relative parts of the code…
Have you looked at this pointerlock controls example? The programs uses the WASD keys to walk. To walk horizontally, press A or D, To walk diagonally press both WA, WD, AS, or SD.
if(keys[“e”] || keys[“q”]){
let vec = new THREE.Vector3(1,0,0).applyQuaternion(camera.quaternion).multiplyScalar(.1);
if (keys[“e”])
camera.position.add(vec );
if (keys[“q”])
camera.position.sub(vec);
}
@Lawrence3DPK @phil_crowther @manthrax
pickd position of player \ and position of player once fwd key applied
then applied diff into camera.position
expectd to work, camera goes into opposite side
it works ! \ browser cache
\ updatd \
@Lawrence3DPK
is there manual how to work with flyin\ hyrocopter?
implement rotation of camera and same camera walkin\
installd bvh, make it have sense
\ updatd
found the issue \ I applied camera.lookAt \
\ updatd
through bvh \ does find objects before actual intersect\ and then i need change direction to walk
through choose mesh children and verify distance to mesh (slow when many objects around)
You may want to consider using a real physics library.. like box3d, ammo, rapier, or cannon.
@Lawrence3DPK
Does it make sense for replacement mesh.position call into dict with positions
Have 100+ children of map
On startin it takes 0.04 s
When walkin into road it takes 0.15 s
High cost \ new Three.Box().setFromObject()
For static object I did dict
walkin obj s high cost
Dynamic box?
\ updatd \
better \ how to remove throats between
here is a rework of one of my demos from a few years ago that may help you.
the camera follows car, and uses the rapier physics engine