Hi, I have been watching a tutorial of Stefan Sietzen which is great by the way and trying to copy what he does.He converts Lat/Long data to xyz coordinates on a sphere with this formula:
I try to achieve this effect on a flat map .I uvproject the points and connected $MAPU, and $MAPV to position and it looks looks like this.I can`t offset the projection and America part is divided from wrong place.Any idea how to use Lat/Long data to project points on a 2D plane.I am new to houdini and I am sorry if it is very basic question.
Lat long data is already on a 2D plane. What exactly are you trying to do? If you have point data with the attributes, “lat” and “long”, skip the spherical transformation, and assign the values to @P. Then apply some scale to go from degrees to your desired range. If you want to change where the ‘seam’ appears, rotate the values (add to longitude).
// begin attribute wrangle codefloatx,y;
x = cos(radians(@long+chf('rotate')));
y = sin(radians(@long+chf('rotate')));
@long = degrees(atan2(y,x));
@P = set(@long,@lat,0);
@P *= 1.0/360; // divide by 360 to make image 1 unit wide and 0.5 units high