2D with Blitz3D

Blitz3D Forums/Blitz3D Programming/2D with Blitz3D

Uhfgood(Posted 2004) [#1]
Can someone help me out on some resources on doing this? Using the blitz3d 3d commands for 2d stuff (using textures and what not). I don't exactly want to use someone elses code, but I would like a starting point to study from so I can write my own 2d-in-3d code. I looked in the Code Archives and didn't see anything, but maybe I just missed some.

Keith


danjo(Posted 2004) [#2]
using the CameraProjMode camera,2 will force it into a 2D-like view.


RiverRatt(Posted 2004) [#3]
Working with 3d, 2d style is very simple. Not much diferent from working with 2d. Its all about exchanging the y and z
axis so y becomes z.(if you want it so that your just looking down on the player that is.) Set up a 3d camera,
create a player and parent the camera to the player.

Graphics 3d 640,480
plane=createplane()
cam=createcamera()
player=createsphere(32,cam);or loadmesh(whatever,cam)
Oh here had this made already.



Complete with basic collisions. And if the player collides with the plane, shields will start to fade. I guess it would be a side scroller here but could be used as a to down just reposition the camera above the player and point it at the player. Which could be anything.


skn3(Posted 2004) [#4]
Somehow I think he meant 3d accelerated 2d. Not 3d that looks like 2d.

http://www.blitzbasic.com/toolbox/toolbox.php?tool=71
Supposedly a nice one. I have not used it.


WolRon(Posted 2004) [#5]
same example without errors:


Tracer(Posted 2004) [#6]
Get SpriteMaster Pro, nothing makes it easier :) (it should be on the blitzcoder showcase)

Tracer


Uhfgood(Posted 2004) [#7]
Yeah sorry I wasn't clear, I meant hardware accelerated 2d (using 3d hardware for sprites and such)... And as I said a starting point to study from so I can write my own routines.

Thanks :-)

Keith


RiverRatt(Posted 2004) [#8]
Oh sorry.
Wolron: What errors?


Rob Farley(Posted 2004) [#9]
JFK has a really simple example in the code archives that I think is a great starting point.


Uhfgood(Posted 2004) [#10]
The only thing that I saw in the code archives (and yes i clicked his name and code archive entries) is a thing that allows you to position blitz3d sprites as you would 2d sprites, but from what i've heard in the past that the blitz3d sprite system is somewhat slow, i'd rather learn to use textures and figure out how to place them myself. So any other resources on using blitz3d and texture mapping to create my own hardware accelerated sprite system?

Thanks


WolRon(Posted 2004) [#11]
Well, for one, you misspelled background as backround. Fatal error...


EOF(Posted 2004) [#12]
Thanks for the endorsement Tracer. (SpriteMasterPro in my sig-link)

Something pretty simple to try out here.
It's a very fast single-surface approach. Not pixel perfect though:




Uhfgood(Posted 2004) [#13]
Thanks alot JimB :-)

Keith


Raul(Posted 2008) [#14]
.

You can also get pixel-perfect 3D planes by placing the camera in the right place, regarding the screen resolution.

example for 800x600:

cam=CreateCamera()
CameraClsMode cam,False,True
PositionEntity cam,(800/2)+0.5,-((600/2)+0.5),-(scrX/2)


.. now, you can control your 3D sprites with 2D coords, but you must negate the Y value.

RESTRICTION: it only runs with 64x64 and 256x256 texture size

.


cyberyoyo(Posted 2008) [#15]
It's rather easy to do, actually there's already the "sprite" commands that can be used for that. But if you want performance, you might want to use a single surface engine, take a look at the code archives you'll find examples.
Also some people recommend orthographic projections which indeed make things easier, but I personally didn't use it because you might want to use 3 perspective for nice parallax effects and also throw in some 3D elements in your 2d backgrounds from time to time.