|How To Setup The Camera|
Supplemental Object Documentation
The Camera object covers the group of components which together make up the entire perspective.
Move the camera in any direction.
Setup and Zoom the projected perspective.
The look-at point of the camera.
The position point of the camera.
The roll angle of the camera around the position.
The following example is based upon the engine being initialized at which point a camera is initialized, and governed by the mouse cursor, joystick, and keyboard objects. If you're writing your first 3d scene or have never dealt with one before you might have problems figuring out how to handle the transformations, but the solution is simple.
' Game Basic 3D Engine Build 4096 ' Copyright © Monarke Studios. All Rights Reserved. Private Camera As New GameBasic3D.Camera ' Engine.Initialize Camera.Set3DFieldOfView 70 Do ' Rotate the camera using the mouse cursor axes Camera.Rotate _ -Cursor.Axes.Y / Speed -Cursor.Axes.X / Speed, 0 ' Rotate the camera using the joystick analog axes Camera.Rotate _ Joystick.Axes.W / Speed Joystick.Axes.Z / Speed, 0 ' Move the Camera using the joystick analog axes Camera.Move _ -Joystick.Axes.X * Speed, 0, _ -Joystick.Axes.Y * Speed ' Move the Camera using the keyboard buttons If Keyboard.Button(KEY_UP) Then Camera.Move 0, 0, Speed If Keyboard.Button(KEY_DOWN) Then Camera.Move 0, 0, -Speed If Keyboard.Button(KEY_LEFT) Then Camera.Move Speed, 0, 0 If Keyboard.Button(KEY_RIGHT) Then Camera.Move -Speed, 0, 0 ' Engine.Pipeline Loop ' Engine.End Set Camera = Nothing
Please note that the objects, and other various effects that can help extend the example are not entirely present but assume you're already familiar working with them. Please refer to the other online content, and technical reference included with the installation for further documentation.