Point on the surface of a sphere

Blitz3D Forums/Blitz3D Programming/Point on the surface of a sphere

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi Siread, I tried that formula and it only works for locations on or near the prime meridian.

I think it should be something like this if your globe is oriented normally with North pointing up the Y axis.

latitude# = -53.10		;Wembley
longitude# = 0.07

theta#=90+latitude : phi#=180+longitude

z# = Sin(theta) * Cos(-phi)
x# = Sin(theta) * Sin(-phi)
y# = Cos(theta)


This is based on the formula given here http://local.wasp.uwa.edu.au/~pbourke/texture_colour/spheremap/
adjusted slightly for the way the axis are oriented in blitz.