Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / 2d and 3d together?

Author
Message
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 16th Sep 2005 10:56
was wondering if it possible to combine sprites and 3d objects in the same game loop. i want to use a sprite for a crosshair in my game but anytime a bitmap is loaded all i get is a black screen. was wondering if there is a way to fix this or if it is even possible.
thank you.

A child's dream never dies.
Fneep
19
Years of Service
User Offline
Joined: 3rd Sep 2005
Location: In my house
Posted: 16th Sep 2005 11:10
Yeah... I dont think its possible to combine 2d and 3d in one loop, but there is a way to get around this. It is actually better if you texture an invisible plain or similar with your crosshair, then position the crosshair in front of the camera, make it so that if the camera moves, the crosshair moves with it or the textured plain will be left behind.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Sep 2005 11:33
2D and 3D is very possible. Sprites are actually 3D plains, locked to the screen.

Quote: "DRAW SPRITES LAST
This command change the order in which sprites are drawn to the screen. By calling this command, all sprites will be drawn to the screen 'after' any 3D is drawn. This will cause the sprites to appear over the top of any 3D being rendered. This is the default behaviour.
"


You should be using LOAD IMAGE, not LOAD BITMAP (unless I have misunderstood what you have written). From the image you then create a SPRITE, and position this on the screen.

smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 16th Sep 2005 18:12
ty for the advice. i figured it out on my own buy looking at the fps demo that came with dbpro. also with the set sprite alpha command i can make them semi transparent worked out perfectly just though id let ya know

A child's dream never dies.
Nul error
19
Years of Service
User Offline
Joined: 12th Aug 2005
Location:
Posted: 16th Sep 2005 22:33
might be more work to do that way, playing breath of fire 4 for pc/ps2 which is sprites on 3d enviroment they have to make the sprite change depending on the rotation of the world.
Leeorg
19
Years of Service
User Offline
Joined: 5th Jul 2005
Location:
Posted: 16th Sep 2005 23:09
Just beware that mixing 2D and 3D together will dramatically reduce your frame rates. You can maintain your frame rate by setting the 2D sprites Transparency to off if you don't need any part of the sprite to be transparent. Setting backsave to off also maintains your framerate. I've had about 20 or so sprites on top of a 3d background and maintaining about 25-30 fps. My laptop is 1.8Ghz with a Ge-Force FX 5200, just to give you an idea of how powerful my computer is and the effect mixing 2d with 3d has on fps.
Fox Dark Master
20
Years of Service
User Offline
Joined: 20th Jul 2004
Location: Portugal
Posted: 16th Sep 2005 23:41
Lol, see this: http://iro.ragnarokonline.com/
Ragnarok uses sprites in a 3D evoriment


True Phantasy
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Sep 2005 00:27
I have a 2D / 3D game runing at 90 FPS. It's around 20 sprites and up to 1600 3D plains.

Login to post a reply

Server time is: 2024-09-24 03:21:53
Your offset time is: 2024-09-24 03:21:53