Suggestion to which C++ 3D engine is better between Ogre, Irrlicht and OpenSceneGraph [closed]

First off, both OpenSceneGraph (OSG for short) and Ogre3D are very well documented, supported, large forum etc… I don’t know much about Irrlicht besides it’s the newest of them. You probably won’t go wrong with either of the first two. Someone mentioned CrystalSpace; I haven’t looked at that in years, but it was far behind … Read more

Move camera to fit 3D scene

There are many possible camera positions + orientations where the bounding box would fit inside the view frustum. But any procedure would select one specific camera position and orientation. If you would consider bounding spheres, one solution could be to first change orientation to look at bounding sphere center then move back sufficiently (negative look … Read more

Circular rotation around an arbitrary axis

http://en.wikipedia.org/wiki/Rotation_matrix. Look under the section Rotation matrix from axis and angle. For your convenience, here’s the matrix you need. It’s a bit hairy. theta is the angle, and ux, uy, and uz are the x, y, and z components of the normalized axis vector If you don’t understand matrices and vectors, post back and I’ll … Read more

procedurally generate a sphere mesh

If there are M lines of latitude (horizontal) and N lines of longitude (vertical), then put dots at (x, y, z) = (sin(Pi * m/M) cos(2Pi * n/N), sin(Pi * m/M) sin(2Pi * n/N), cos(Pi * m/M)) for each m in { 0, …, M } and n in { 0, …, N-1 } and … Read more

Three.JS rotate projection so that the y axis becomes the z-axis

You could just change the camera rather than the entire coordinate system. For example: var WIDTH = 1024; var HEIGHT = 768; var VIEW_ANGLE = 45; var ASPECT = WIDTH / HEIGHT; var NEAR = 0.1; var FAR = 10000; camera = new THREE.PerspectiveCamera(VIEW_ANGLE, ASPECT, NEAR, FAR); camera.position.z = 300; camera.up = new THREE.Vector3( 0, … Read more

3D Line-Plane Intersection

Here is a Python example which finds the intersection of a line and a plane. Where the plane can be either a point and a normal, or a 4d vector (normal form), In the examples below (code for both is provided). Also note that this function calculates a value representing where the point is on … Read more

Converting 3D position to 2d screen position [r69!]

I’ve written for my project the following function; it receives an THREE.Object3D instance and a camera as a parameters and returns the position on the screen. function toScreenPosition(obj, camera) { var vector = new THREE.Vector3(); var widthHalf = 0.5*renderer.context.canvas.width; var heightHalf = 0.5*renderer.context.canvas.height; obj.updateMatrixWorld(); vector.setFromMatrixPosition(obj.matrixWorld); vector.project(camera); vector.x = ( vector.x * widthHalf ) + widthHalf; … Read more

techhipbettruvabetnorabahisbahis forumu