One quick question here

Blitz3D Forums/Blitz3D Programming/One quick question here

seferey(Posted 2005) [#1]
My question is

Can you control the camera with the movement of the mouse alone If so how?


Andy(Posted 2005) [#2]
Of course.

Just reset the mousepointer to the center of the screen every now an then and then check how far it has moved.

Andy


jfk EO-11110(Posted 2005) [#3]
You can use MouseYSpeed() for walking forward and backward, and MouseXSpeed to turn around. Of course, while frequently reseting the mousepointer to the center of the screen, as Andy suggested.


Graythe(Posted 2005) [#4]
MouseXSpeed() example;

Const PelStep = 8

Graphics3D 640,480,32,2
Camera=CreateCamera()
Light=CreateLight(Camera)

PelCount=64
LastPel=PelCount-1
RoomTexture=CreateTexture(PelCount,PelCount,1)

SetBuffer TextureBuffer(RoomTexture)
ClsColor 0,200,0
Cls
For X=False To LastPel Step PelStep
	For Y=False To LastPel Step PelStep
		WritePixel X,Y,False
	Next
Next
SetBuffer BackBuffer()

RoomEntity=CreateCube()
ScaleEntity RoomEntity,-10,-10,-10
EntityTexture RoomEntity,RoomTexture

Repeat
	
	TurnEntity Camera,0,MouseXSpeed(),0
	RenderWorld
	Flip
	
Until KeyHit(1)