Find if point lies on line segment

Find the distance of point P from both the line end points A, B. If AB = AP + PB, then P lies on the line segment AB. AB = sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)+(z2-z1)*(z2-z1)); AP = sqrt((x-x1)*(x-x1)+(y-y1)*(y-y1)+(z-z1)*(z-z1)); PB = sqrt((x2-x)*(x2-x)+(y2-y)*(y2-y)+(z2-z)*(z2-z)); if(AB == AP + PB) return true;

Custom WP7 Silverlight control with dynamic 3D content

I couldn’t find any way of detecting that a Silverlight control needs to change its presentation, be it due to user interaction or animation. Controls are rendered only when the 3D scene changes because of this, and so they lack the slick look and feel of the native WP7 applications. Make something that always changes … 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 outer glow for sphere object?

I’ve worked a bit on separating out the part of the WebGL Globe code (linked to above) that produces the atmospheric effect. A preliminary working version is here: http://stemkoski.github.io/Three.js/Atmosphere.html To the best of my understanding, there are a few interesting things going on in the original code to create the atmospheric effect. First, the glowing … Read more

Unity, Torque3D, Google O3D, WebGl….which to choose? [closed]

WebGL is not a failure in the making. Speaking like it’s a failure shows these peoples ignorance. That said, if you’re just starting out, explore your options. If you’re looking for more eyes than just windows users, stay away from proprietary solutions. Microsoft’s dominance isn’t big as people think, anymore. IE is fading in popularity, … 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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)