Cameras & Movement

Blitz3D Forums/Blitz3D Programming/Cameras & Movement

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.

As DJWoodgate says, use Tformnormal ...

Speed# = .5

	If Mx <> 0 Or Mz <> 0
		;move relative to camera
		TFormNormal Mx, 0, Mz , CAMERApivot , 0
		TranslateEntity CUBE, TFormedX() * Speed , 0, TFormedZ() * Speed
		;turn relative to movement
		PositionEntity TARGET, EntityX( CUBE ) + TFormedX() , 0, EntityZ( CUBE ) + TFormedZ()
		TurnEntity CUBE, 0 , DeltaYaw( CUBE, TARGET ) * .25, 0
	EndIf


I doubt that there is another more efficient way. The target pivot is required to obtain orientation relative to the camera - which your always going to need.

Stevie