Check out Amazon.com!

BlitzCoder Code Archives PageMain Codes Page
Listing: 3D Games (30 Entries)
Title: 2 line FPS code Code Submitted By:
- andreas_blixt

This code has now been updated to be much more accurate and it still uses 2 lines! To get the current FPS, just use CurFPS#.
 
Title: Cool 3D Intro Sequence -- Version 2 Code Submitted By:
- g8w4y
This builds a logo out of coloured cubes, the image of which is loaded from an image up to 32 x 32 pixels. This is excellent for splash screens etc, and a simple (and bad) example bmp image can be found at http://www.angelfire.com/musicals/yaar/blitz.bmp for those too lazy to make their own :-). You don't need to put my name anywhere, but the credit would be nice.

New version adds saving support and images don't have to be exactly 32 x 32...
 
Title: CreateSquare (plane but not infinite) Code Submitted By:
- abraham

Like create plane like createplane() but not infinte. You can define the size and vertices in the plane and if handle is central or leave it at bottom left hand corner.
 
Title: DMT, DEM, VDXLIGHTING Code Submitted By:
- nofrontier

Too long for the short title:

- Dynamic Mesh Trail effect, which uses the new VertexAlpha thing,
- Dynamic Environment Mapping, through copyrect and flag 256+64
- And a nice DXlight effect

The Dynamic Mesh Trail original basic functions are by Ben Gillbank, modified along some hour of coding last night.
All the rest is genuine instant from-skratch blitz3d coding.

Enjoy it, mod it, use it, credit me! :)
 
Title: DigitText Code Submitted By:
- markrosten
Displaying text on a HUD using a custom mesh (and loaded font image)
 
Title: Equilateral Polygon Creation Code Code Submitted By:
- huntersd

Creates an equilateral polygon of the radius and width specified.

 
Title: Example - Adjusting UV Co-ords on simple quad meshes Code Submitted By:
- snarkbait
An example of how to adjust the UV texture coords on a simple, 2-poly quad mesh. Use any square image to test.
 
Title: Fast Image Information Code Submitted By:
- code_666

At the moment, the only way to get an image's width/height is to first load it and then use the ImageWidth()/ImageHeight() commands. If you are using code that makes a decision whether to use an image based on this information, loading the whole image into memory - just to then discard it - is slow and wasteful, not to mention time consuming!

What my code does is to jump into the file stream and pull out the information directly and then calculate the width and the height - thus negating the need to load the whole file into memory first. This is a much faster way of doing things, especially with large images.

An added bonus is that the code does not determine the image's type based on the file extension you feed the function, it checks the file for it's signature and then acts accordingly. Room has been left in the logic for coders to add their own formats and/or formats not supported by this code. The code's logic differentiates between header and footer signatures, primarily for ease of use and speed.

Code is free to use - all I ask is for recognition in the program.
 
Title: First person shooter camera control source code Code Submitted By:
- edzup

This code allows the user to run/walk/fly, jump, and look around. The variable player gravity can also be used for fall damage, each cycle the player isnt touching anything it is deducted the gravity# value.

To do fall damage check PlayerGravity to see if its gone below the safe limits and if so when the player hits something damage them accordingly.

*** The only requirement I ask is if you use this code can you put my name in the credits, Thank you ***
 
Title: Full Screen Motion Blur Code Submitted By:
- ban300

Use this to apply a motion blur to the screen. This is for 3D applications. The comments should explain how to use the code. Basically call SetupBlurCamera() right after you create your main viewport camera and then call BlurScreen() before RenderWorld. By toying with the blur_severity and falloff values you can drastically alter the effect. You can further alter it by changing the blur_magnitude in BlurScreen().
 
Title: Grass and plant system. inifite. Code Submitted By:
- wingsoffury

This is a grass/plant system that i hacked in about 2 hours.
you can walk forever in this world. never reach it borders.
its about 200 grasses no more at once.
I hope some one like it. :)
 
Title: How to read RPG dialogs from a text file Code Submitted By:
- dragonmood

Say you want to read characters dialogs that you want to use in a game.
You ll need :
1- a way to store it -> I propose text file in this format :
[0.0.1]
This is chapter 0,section 0,conversation 1,line 1
This is chapter 0,section 0,conversation 1,line 2
[0.0.2]
This is chapter 0,section 0,conversation 2,line 1
etc...
2 - and a function to read it from a blitz application -> my code.
Feel free touse,Any comment is welcome.

 
Title: Include Code For First Person control Code Submitted By:
- arwell
Add 2 new Functions for Player Move and Player Collision.
 
Title: Join and Split Banks Code Submitted By:
- poedboy
Two functions for merging two banks into a single Bank, or splitting a single bank into two seperate banks.
 
Title: Mark's 3d bullets with collisions Code Submitted By:
- markrosten

An example of how to move a player around, fire bullets, and have those bullets collide with objects (removing them).
 
Title: Portable Lightmapper Code Submitted By:
- starfox

Here is the lightmapper that I planned to release sooner or later. It isn't perfect, but good enough for my needs since it was only a test, to see I was capable of creating a lightmapper. The only requirement for using this lightmapper is to give me credit in any of the used programs.
 
Title: Positioning 3d entities in 2d, relative to the camera Code Submitted By:
- markrosten
A set of functions to try and simplify the positioning of entities using 2d coordinates, relative to camera. Great for HUD objects like scores and overlayed map sprites, etc.
 
Title: Record and entity's position and rotation for playback Code Submitted By:
- matt griffiths

does what it says on the tin. you can use it to make in game real-time demos or AI, or anything.
 
Title: Replaying user input using a collection of Types Code Submitted By:
- matt_sephton
23/24 June 2002, version 0.10, tracks user controlled element
26/27 June 2002, version 0.20, tracks multiple computer controlled elements

to do: enable early quit of replay to go back to game

*** feel free to use this method as long as you give me credit

this method can be used to replay user input. this simple demo records the player control of a dot. we choose to do the correct branch of the main loop (moving or drawing) depending on if we are recording (game) or replaying (watching). this could be extended to keep track of multiple items, such as computer/AI controlled characters.

:) matt
 
Title: Shooting bullets with pick check to make sure they dont pass through entities Code Submitted By:
- edzup
Shooting bullets with pick check to make sure they dont pass through entities, with this you can have bullets that travel fast speeds without having to worry about them missing entities in between moves.
 
Title: Sprite Control - 2D<>3D * UPDATE* 16 Dec 02 Code Submitted By:
- syntax_error

A set of commands and functions for manipulating 3d entity sprites just like you would with 2D images.

Key features:

* Display a 3d sprite just like a 2d image
* Use 2D screen coordinates for positioning
* Resize in pixel dimensions
* Rotate / Fade / Recolor
* Works with any 3D graphics mode
* Any camera zoom ratio
* Sprites are displayed at their correct image pixel width & height
* Similar to 2d image commands in operation


Sprite Control 2D<>3D commands & Functions

##########################################

SpriteCamera maincamera[,distance]
sprite=LoadImage3D("myimage.bmp"[,flags])
sprite=CopyImage3D(existingsprite)
sprite=GrabImage3D(x,y,w,h)
sprite=Text3D(text$[,flags]))
DrawImage3D sprite,x#,y#
ResizeImage3D sprite,width,height
RotateImage3D sprite,angle#
HandleImage3D sprite,xoffset#,yoffset#
w=ImageWidth3D(sprite)
h=ImageHeight3D(sprite)
hx#=ImageXHandle3D(sprite)
hy=ImageYHandle(img)
AlphaImage3D sprite,alphavalue#
FlipImage3D sprite[,horizontalflag][,verticalflag]

##########################################


See ShowCase -> Functions > SpriteControl 2D<>3D
 
Title: String Manipulation Library Code Submitted By:
- coderlaureate

I use this library in many of my Blitz programs that require intense parsing of string information.
 
Title: TGA's Code Submitted By:
- poedboy
Allows you to Create, Modify, Save, and Load tga's with alpha information. Works in blitz 2d, 3d, and plus.
 
Title: True 3D Visibility / Line of Sight code (pseudo LOS) Code Submitted By:
- opticevil
This is an example of how to check if any part of an entity is visible to the camera. It even returns how much of an entity is visible. Visibility can even be masked through 3 channels. Super fast, does 80 fps at 640x480 and supports a unlimited number of entities with very little slowdown. Useful for games like Splinter cell and SOCOM ect.
 
Title: Types within Types Code Submitted By:
- skn3_acoders

You can do types within types with a little bit of pre work making some functions.

Check it out !
 
Title: Updating mouse coordinates when mouse leaves window Code Submitted By:
- cyberseth
With the help of a userlib, shows how to continue checking for mouse position even when mouse has gone outside of the window area. Important for windowed games!
 
Title: Vector Graphics Lib With Collisions Code Submitted By:
- darkeagle
use vector graphics easily, and check collisions. useful for if you are doing 2d in 3d and are having trouble with collisions - just set up a basic shape for each sprite you are using, then use VectorsCollide() to check for collisions! even includes scaling and rotation :)
 
Title: Very simple waypoints Code Submitted By:
- cyanide
Someone asked for something and i got the wrong idea so heres a very basic basic waypoint thingy
 
Title: position 3d sprites with 2d co-ords Code Submitted By:
- darkeagle

lets you say "i want bloke A at screen co-ords 400,218. but i want alpha and real time scaling/rotating aswell!.
 
Title: real 3d bouncing Code Submitted By:
- darkeagle
really really cool... just enable collisions with the world and any objects you want the ball to bounce with, and let this code do its stuff :) bouncy bouncy!
 
Add Your Code!
Copyright(c) 2000-2004, BlitzCoder. All Rights Reserved.

Code software created by Krylar's Kreations