Positional Spherical Mapping?

BlitzMax Forums/BlitzMax Programming/Positional Spherical Mapping?

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.

Ant,

Your code did not work as I thought, I made some minor changes and not it works like a dream. There is still work to be done as I need to calculate the centre of mass before calculating the map.

Code as is

Function SphereMap( spX#,spY#,x#,y#,U:Float Var,V:Float Var )
        xd# = x - spX
	yd# = y - spY
	mag# = Sqr(xd*xd + yd*yd)
	xd = xd / mag
	yd = yd / mag
	u = (xd/2) + 0.5
	v = -(yd/2) + 0.5
End Function


GISH type Tar blobs here I come.