3 axis object movement

Blitz3D Forums/Blitz3D Programming/3 axis object 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.

I now understand that you don't want to turn the mesh, but you want to move it. I haven't tested this function, but it is what I would try the first:
;to ensure that is an axis is selected, it stays selected while the mouse is down
Global Picked

;check mouse mode
If Not (method$ = "Mouse - Free") Then Return

;test if mouse is down
If Not (MouseDown(1)) Then Return

;move mouse
mouse_Y# = mouse_Y# + MouseYSpeed()

;only perform axis test on mousehit
If MouseHit(1) Then

	;perform mousepick
	picked = CameraPick(cam, MouseX(), MouseY())
	
End If

;test if an axis is picked
test = (picked = x_axis) Or (picked = y_axis) Or (picked = z_axis)
If Not test Then Return

;transform mouse on the Z axis of the picked arrow
;assumed is the orig. arrow model points to the front
TFormPoint 0, 0, mouse_Y, 0, picked

;move selected objects
;For e.Entity = Each Entity
	If (e\sel) Then
		TranslateEntity e\mesh, TFormedX(), TFormedY(), TFormedZ()
		;MoveEntity e\mesh, tformedX(), tformedY(), tformedZ(), 1
	End If
;Next

If it doesn't work, try first to make the object move along with the MouseY() coordinate. If you move the mouse up/down, the object should move forward/backward.
Then you can use TFormPoint to change this angle for the other arrows. Later on, you could fit in MouseX() if needed.