maybe i should give you the context of what i'm trying to do - user draws 2d floor plan, the program then construct a room with walls based on the plan - so from 2d vectors, i constructed walls using extrude, so no, i don't really have the rotation of the walls) - use chooses a wall, add windows to it on the 2d plane - for the windows in 3d, i just use box geometry, size it accordingly
var quaternion = new THREE.Quaternion().setFromUnitVectors(new THREE.Vector3(1, 0, 0), (new THREE.Vector3(x2, y2, z2) - new THREE.Vector3(x1, y1, z1)).normalise());
you might have to play with the first vector. it'll be 1 or -1 in one of the 3 directions. depends on how the two walls are oriented.
there, that edit should do it
and I'm not sure you can directly subtract vectors with three.js, lol, but there should be a similar method
var right = new THREE.Vector3(1, 0, 0);
var wallDirection = (new THREE.Vector3(x2, y2, z2) - new THREE.Vector3(x1, y1, z1)).normalize();
var quaternion = new THREE.Quaternion().setFromUnitVectors(right, wallDirection);
I am...kind of. But only part time, and one of my school projects is going to kill me for the rest of the semester so I probably shouldn't pick up a new job yet anyway. Next semester might be better if my capstone doesn't kill me in the same way.
I made my own bare bones game framework and started on a math library just because I didn't have any good ideas for a real game and I wanted to learn how it all works. I probably wouldn't have been able to help if I didn't do that.
even gamedev degrees focus too much on "how to program" and not much on "how to solve gamedev related problems"
which is necessary, but sometimes sad
not sure if that changes for postgrad degrees. haven't gotten there yet.
well, my point is that "how to program" is more fundamental than the abstract "subtracting a vector from another vector just changes the origin of the first vector and this will be very useful very often"
most people enter college not even knowing how to program, so those bigger picture, abstract things are pretty hard to teach
People take game classes because games are fun. Who doesn't like games? What they don't realize is that they're not giving people who actually want experience in that industry a chance and hogging up class resources so that they can have some downtime (they don't know how hard game dev is until they do it) or have fun.