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.

DarkBASIC Discussion / Is it possible to paste background image then position 3d object then paste ANOTHER foreground image on top?

Author
Message
billy777
22
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 30th Apr 2009 22:44 Edited at: 30th Apr 2009 22:47
Please see attached screen shot...

What I am trying to do is very basic stuff for a point and click adventure style game.

Basically I am pasting a background image first (BRIDGE) using DRAW TO BACK command

Then positioning a 3d model of man onto background (MAN)

Then I place a TEXTURED PLAIN with foreground image (TREE) so the man walks behind tree.

However... if I create a PLAIN and then texture it for the foreground graphic... it comes out all grainy and pixelated...

MY QUESTION: Is there anyway to paste an image... then position a 3d object... then paste ANOTHER image (to appear in front of 3d objects)? Rather than using a TEXTURED PLAIN for the foreground object?



Thanks
Bill

Attachments

Login to view attachments
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 30th Apr 2009 22:57
What you could do is turn on the backdrop, place the model, get the image of the person, then turn the backdrop off and paste all 3 images.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
billy777
22
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 1st May 2009 00:40 Edited at: 1st May 2009 00:46
Thanks BN2 Productions... I tried it out and it works - very clever!

However... this limits some of the 3d stuff I would like to do... I was planing on doing some fire and smoke, particles, etc using multiple plains,etc. but as you probably know... when you GET image and then try to paste with transparency it doesn't really look smooth and un-edged, etc.

I was kind of hoping there was someway to use memblocks or possibly if this was handled BETTER in darkbasic pro - if it would allow me to paste ANOTHER image over the top off 3d stuff... then I would just purchase PRO and use that instead.

Any ideas are greatly appreciated.
Thanks
Bill
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 1st May 2009 01:54
i may have misread wat u asked about if pro was betr but pro has its own special particle commands so its MUCH easier to work with than many planes

There are only 10 kinds of people in the world, those who understand binary and those who dont
billy777
22
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 1st May 2009 02:19
Thanks smartguy...

but I guess I am really asking if you use the DRAW TO BACK command then paste images forcing the 3d object on top of images... if theres a way to force one more image on top (the foreground)

EXAMPLE:

paste background image... then do 3d stuff(3d stuff infront of background image)... then paste foreground image(3d stuff behind this image)... then sync

Thanks
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 1st May 2009 02:51
@billy777
To use a textured plain the plain and the image to texture onto it have to be the exact same dimensions in 3d and 2d, otherwise you will get scaled texels on the plain (plane). That means, the diemsions of the plain have to be exactly the same as the dimensions of the image.

In order for the plain with the image to appear as the correct size of the original image, you have to find the distance to what we'll call the drawing plane (zdist#). That is the distance away from the camera where 1 2d pixel equals 1 3d unit. This is based on screen resolution. Anyway, I'll just write the formula in the following example. If you are interested in the derivation, just ask. Once you position the plain at zdist#, because it is supposed to be in the foreground, you'll have to use DISABLE OBJECT ZDEPTH. Also, in order for the lighting to be consistant for the image, if you are using dbc 1.20, set the plain's emissive with: set object emissive obj,rgb(255,255,255) to make the image not influenced by the scene lighting and to retain it's original brightness.

I use a circle which is probably not the best example, you could try out the method with some decent images.



Enjoy your day.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 1st May 2009 03:30
ummmm....... whats wrong with texture backdrop?

this turns the backdrop (the blue behind 3d stuff) into an image, just paste what u need onto a second bmp then use get image to make an image of everything u need behind the 3d then use texture backdrop

There are only 10 kinds of people in the world, those who understand binary and those who dont
billy777
22
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 1st May 2009 04:55 Edited at: 1st May 2009 04:58
@Latch: Thanks latch.. I tried it out... it works... its very very close... but not quite as good as a paste image.

see attached screenshot

(I may have to go with this though)

@smartguy: Yes.. this would be perfect... but I think backdrop can only be textured with 6 images in tiled form... Am I correct?

Attachments

Login to view attachments
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 1st May 2009 05:14
what u mean tiled form?

im just sayin paste all the images u want in the background onto an off screen bitmap, then set that bmp to the current one and use get image to take a snapshot of the whole screen, or however much of it ull need to get all the pasted image into the snapshot

then just texture the backdrop with that screen snapshot

beware though if you dont take a pic the same size as ur display mode cuz stuff will be scaled to fill the screen

this works like a green screen in special effects, hides all of a certain color behind the scene and replaces it with a set image

There are only 10 kinds of people in the world, those who understand binary and those who dont
billy777
22
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 1st May 2009 05:27
Quote: "what u mean tiled form?"



from the instruction manual...using "texture backdrop" command

TEXTURE BACKDROP: the textures are pasted onto the backdrop as two rows of 3 tiles, which create six visible textures that make up the backdrop.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 1st May 2009 05:34
Quote: "from the instruction manual"

who reads the manual?

ok i didnt know that, i thought it worked just like texturing a plane

There are only 10 kinds of people in the world, those who understand binary and those who dont
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 1st May 2009 07:38 Edited at: 1st May 2009 07:42
@billy777
Quote: "its very very close... but not quite as good as a paste image"

hmmm... strange, should be a 1:1 ratio if the sizes are matched between 2d and 3d... must be image compression for the texture. Maybe if you load the image as .dds . Also make sure autocam is off and you are positioning the camera yourself.


For just using images, how about:

draw to back
paste background
place object
draw to front
paste foreground

One other method, though it will probably destroy your frame rate: use a sprite for the foreground. It will always be on top of everything - 2d 3d - everything. If the sprite isn't moving, disable the sprite's internal redraw (backsave). That'll improve performance.

set sprite <num>,0,1

Just curious, what 3d modeling software are you capturing your rendered images from?

Enjoy your day.
billy777
22
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 1st May 2009 19:57 Edited at: 1st May 2009 19:59
@latch: Thanks again.... In order for me to have the ISO view, etc... the camera's location, distance, etc, may be influencing the view of the plain and I think there could be an issue because the camera angle x is not 0 - I put a "set orientation to camera" for the plain and disabled the zdepth.

Isn't there a trick to getting a plain to STICK to the screen - no matter what the angle of the camera is... you know... for mini maps, etc. or is that just the disable zdepth thing?


I will try your idea about using both the "draw to back" and "draw to front" inside a single sync cycle... however... not sure I can do that? I think it uses the last "draw to" before the sync?

Try the sprite thing too.

Thanks
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 1st May 2009 20:07
ahh... LOCK OBJECT ON should lock the plain to the camera - though lighting affects locked objects a little differently.

Quote: "I will try your idea about using both the "draw to back" and "draw to front" inside a single sync cycle... however... not sure I can do that? I think it uses the last "draw to" before the sync?"


Might require multiple syncs... I didn't think of that. I'll have to try it out myself.

Enjoy your day.
billy777
22
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 1st May 2009 22:25
Oh... yes... I forgot about LOCK OBJECT ON... tried it it works... however... I tried the sprite thing - at first very slow but looks the best... then tried disabling the backsave for sprite... that works the best.

Thanks

Login to post a reply

Server time is: 2025-06-08 05:45:06
Your offset time is: 2025-06-08 05:45:06