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 / foreground image?

Author
Message
chilledoutjohn
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 4th Jul 2004 06:44
Evening

Has anyone any idea how i can draw an image on the foreground of a 3d scene that wont loose me to many fps? It would need to be some sort of sprie i geuess but i want it fixed to the camera and i need sections of it see-thu.

any sugestions?

cheers
Monzi
20
Years of Service
User Offline
Joined: 10th May 2004
Location: Denmark
Posted: 4th Jul 2004 07:12
Don't you mean a background image?

- b00h
chilledoutjohn
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 4th Jul 2004 07:14
no ive got that one done, foreground is what im after Pre-rendered engine in the works
DeepBlue
21
Years of Service
User Offline
Joined: 17th May 2003
Location: A little box in the UK
Posted: 4th Jul 2004 07:52
You can either use a sprite that will be persistent (will be visible after creation, without further intervention between sync commands).

I would warn that this can be slow if you are going to be updating the image (get image commands really slow things down)

Depending on what you want you could of course use an animated sprite.

You can use Paste Image, this is generally faster but you will have to call it before the sync command (remembering that the last things drawn will appear infront of the previous things drawn), also slows down if you start to use get image if required for manipulation.

Both of the above can be set to be transparent, the default color being black rgb( 0,0,0 ) but can be changed through code or by using an alpha map.

The quickest way to put an image on the screen I have found is to draw directly to bitmap 0 or use copy bitmap (to bitmap 0), but then you will lose transparency unless you can get clever about what you are drawing/copying.

The coder formerly known as Twynklet.
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 4th Jul 2004 07:53
For a foreground image, I'd personally use a plane textured with a bitmap. This makes it essentially a sprite but won't cost you in frame rate like mixing 2D and 3D like what happens in directx 7. You would of course need to move the plane along with your camera position, so it stays at a constant distane and appears an "overlay" to the current setting.

Any truly great code should be indisguishable from magic.

Login to post a reply

Server time is: 2024-11-26 23:44:07
Your offset time is: 2024-11-26 23:44:07