Convert a vector to another vector's space?

Blitz3D Forums/Blitz3D Programming/Convert a vector to another vector's space?

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.

It's not really possible, I asked the same question here before when I was doing dot3 stuff in blitz.

The closest I came was to allign a pivot to the target vector, then tform the tangent vector by that.

            PointEntity lpiv1,spiv
		PointEntity spiv,lpiv1
		
	
		AlignToVector spiv,nox,noy,noz,0
		AlignToVector spiv,nox,noy,noz,2
			
	
		TFormVector2(vx,vy,vz,nox,noy,noz)
		ar=128.0+(128.0*TFormedX())
		ag=128.0+(128.0*TFormedY())
		ab=128.0+(128.0*TFormedZ())
		


vx,vy,vz=vertex position, nox,noy etc=normal.lpiv being a pivot at the vertex position and spiv, being a pivot projected in the direction of the target vector.