game programming step-01 how to create a camera to render the game
TRANSCRIPT
Game Programming Step-01
how to create a camera to render the game
http://www.prasansoft.com
Purpose Step 01
• Learn how to create a camera to render the game.
• Learn to build a ground game.
• Learn how to create a game loop for processing time.
http://www.prasansoft.com
Write Command Step-01
SET CAMERA RANGE 0,0.2,10000 Make CameraMAKE MATRIX 1,5000,5000,20,20 Make FloorSET MATRIX HEIGHT 1,0,0,100UPDATE MATRIX 1
DO Make Real-Time Render
SET TEXT FONT "COURIER NEW" SET TEXT SIZE 16 SET TEXT TO BOLD SET CURSOR 20,50 PRINT "STEP-001 set up camera"SET CURSOR 20,70PRINT " YOU CAN SEE SCREEN IN 3DGAME RENDER BY CAMERA "
LOOP Loop Real-Time Render
http://www.prasansoft.com
SET CAMERA RANGE
This command will set the viewing range of the camera.
The Front Value specifies the closest point beyond
which the camera starts to draw the 3D scene.
• Syntax • SET CAMERA RANGE Camera Number, Near Value, Far Value
• Example• SET CAMERA RANGE 0,0.2,10000
http://www.prasansoft.com
MAKE MATRIX
• This command will create a matrix to a given width and depth segmented into grid square of a specified arrangement.
• Syntax • MAKE MATRIX Matrix Number, Width, Height, XSegments, ZSegments
• Example• MAKE MATRIX 1,5000,5000,20,20
http://www.prasansoft.com
SET MATRIX HEIGHT
• This command will set the individual height of a point within the matrix. To raise a whole grid square you would need to raise four points.
• Syntax • SET MATRIX HEIGHT Matrix Number, TileX, TileZ, Height
• Example• SET MATRIX HEIGHT 1,0,0,100
http://www.prasansoft.com
UPDATE MATRIX
• This command will update all changes you have made to an existing matrix.
• Syntax • UPDATE MATRIX Matrix Number
• Example• UPDATE MATRIX 1
http://www.prasansoft.com
DO
• These commands will define a loop that will repeat indefinitely. You are able to break from the loop at any time by using the EXIT command.
• Syntax • DO
• Example• DO
http://www.prasansoft.com
SET TEXT FONT
• This command will set the typeface of the font you wish to use.
• You can optionally specify a character set value when selecting your font.
• Syntax • SET TEXT FONT Fontname
• Example• SET TEXT FONT "COURIER NEW"
http://www.prasansoft.com
SET TEXT SIZE
This command will set the point size of any text you are about to output.
The point size should be an integer value.
• Syntax • SET TEXT SIZE value
• Example• SET TEXT SIZE 16
http://www.prasansoft.com
SET TEXT TO BOLD
This command will set the text style to bold and non-italic.
• Syntax • SET TEXT TO BOLD
• Example
• SET TEXT TO BOLD
http://www.prasansoft.com
SET CURSOR • This command will set the cursor position used by the PRINT command
• Syntax • SET CURSOR X,Y
• Example• SET CURSOR 20,50
http://www.prasansoft.com
This command will print text, numbers, variables
and strings to the screen. You can position where
the text will print using the
SET CURSOR command.
• Syntax • PRINT Print Statements
• Example• PRINT " YOU CAN SEE SCREEN "
http://www.prasansoft.com
LOOP
These commands will define a loop that will repeat indefinitely.
You are able to break from the loop at any time by using the EXIT command.
• Syntax • LOOP
• Example• LOOP
http://www.prasansoft.com
Result Step-01