Convert Latitude and Longitude to point in 3D space

I’ve reformatted the code that was previously mentioned here, but more importantly you have left out some of the equations mentioned in the link provided by Niklas R def LLHtoECEF(lat, lon, alt): # see http://www.mathworks.de/help/toolbox/aeroblks/llatoecefposition.html rad = np.float64(6378137.0) # Radius of the Earth (in meters) f = np.float64(1.0/298.257223563) # Flattening factor WGS84 Model cosLat = … Read more

How do I rotate a Quaternion with 2nd Quaternion on its local or world axes without using transform.Rotate?

Use the Quaternion operator *. In Unity, when you multiply two quaternions, it applies the second quaternion (expressed in global axes) to the first quaternion along the local axes produced after the first Quaternion). So, if you want to do the equivalent of Rotate(q2, Space.Self), where q1 is the transform’s original rotation, and q3 is … Read more

DirectX/C++ 3D Engine programming: Learn now, or wait for DirectX 12? [closed]

Think of DX12 as “DirectX without training wheels, without brakes, and at the moment maybe without tires”. It will be more than a ‘few months’ for DirectX 12 to have a rich set of tutorials, support libraries, best practices, rock-solid drivers, and widely deployed support in the operating system on end-users machines. It’s “bleed edge” … Read more

JavaFX 3D Transparency

Since JDK8u60 b14 transparency is enabled in 3D shapes. This is a quick test done with it: A cylinder with diffuse color Color.web(“#ffff0080”), is added on top of a box and two spheres. group.getChildren().addAll(sphere1, sphere2, box, cylinder); There’s no depth sort algorithm though, meaning that order of how 3D shapes are added to the scene … Read more

Texture splatting with Three.js

Challenge accepted! First, you can write a vertex shader that takes a grayscale image and uses it as a heightmap, and includes a varying float (called vAmount below) to pass to the fragment shader to determine the texture(s) to display(blend) at that point. uniform sampler2D bumpTexture; uniform float bumpScale; varying float vAmount; varying vec2 vUV; … Read more