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 / 3d on multiple bitmaps?

Author
Message
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 31st May 2009 21:36
how do i get 3d to show up on a bitmap other then 0 without using get/paste image from the main one.

New Site! Check it out \/
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 31st May 2009 21:51
Here you go:



TheComet


Make the path of your enemies easier with Waypoint Pro!
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 1st Jun 2009 02:03 Edited at: 1st Jun 2009 02:09
Oh ok! lol wasn't sure how to go about that. i thought you had to set bakdrop on each bitmap or something. this is easier lol


Just wondering:

is there a way to have multiple backdrops, what i mean is if you make 2 objects and want them on 2 backdrops then on one you would see one object and the other is on the 2nd backdrop

New Site! Check it out \/
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 1st Jun 2009 06:19 Edited at: 1st Jun 2009 06:32
@TheComet
That's a good attempt, but I believe 3d isn't drawn to any bitmap except 0. The only reason we can see the cube when you use Sprite, is because bitmap 1 is black and sprites are transparent by default.

Take away the transparency and all we see is the black screen captured from bitmap 1:



@Caleb
Quote: "is there a way to have multiple backdrops, what i mean is if you make 2 objects and want them on 2 backdrops then on one you would see one object and the other is on the 2nd backdrop"

No, not really. However, using a variation of TheComet's idea, you could use a black solid sprite to cover up the 3d view of bitmap 0. Behind the sprite, you could use COPY BITMAP 0 to some other bitmap for "backdrop 1" then change the 3d view and COPY BITMAP 0 to another bitmap for "backdrop 2". Then change the sprite that is in front of bitmap 0 with an image of "backdrop 1" or "backdrop 2"; or hide the sprite and copy "backdrop 1" or "backdrop 2" to bitmap 0. Backdrop is in quotes because it's not really a backdrop, it's
a bitmap or image of screen 0 with different information drawn on it.

If you want to get real complicated, you could render your own camera view in memory (memblock) using a DLL for speed. You'd have to do your own maths taking into account world coordinates, field of view, camera angles, and the objects to render, vertices. Then convert that view to an image and display it. Not easy. But possible. Probably could use some of the directx functions, or maybe even opengl to do the math. In the end, you'd have to come up with a 2d image of a 3d view based on the calculations. In theory, you could then have as many cameras simultaneously as you want in DBC. Great for mirrors, texture rendering, split views, all sorts of things. The main problem being that there's no way to get at the memory in DBC where the real objects / textures are stored so you'd have to double load/reference everything.

Enjoy your day.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Jun 2009 12:15
Oh. *Slap head*

Damn, I should have known... Sorry...

TheComet


Make the path of your enemies easier with Waypoint Pro!
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 1st Jun 2009 16:26
Oh hmmmm that sounds a little too complicated for what i need, thanks anyway!


Comet:

I was hoping that would work lol it looked like it did ha.

New Site! Check it out \/
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 1st Jun 2009 17:05
What're you trying to do? Maybe there's a simple soultion.

Enjoy your day.
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 1st Jun 2009 17:29
Well i was just thinking about my GUI thing maybe having a camera in a window.

the only thing i can think is store all the object numbers, camera positions, camera angles and then when you refresh that bitmap it just hides all the objects exept the ones assotiated with that window and positions and points the camera in the right direction but that would bog the speed down ALOT probably.

Or maybe just always have all the objects hidden and then show the ones you need. but it would still be slow.

it's not a important thing, idk if anyone would even use it but i thought it would be cool if it was there.

New Site! Check it out \/
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 1st Jun 2009 17:56 Edited at: 1st Jun 2009 18:02
Well, if you want a 3d view in a window, in fact several windows (though the more you have the worse the performance), use set camera view for each occurance of the 3d window:



Enjoy your day.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Jun 2009 18:52
Very nice, Latch!

If you use multiple 3D views, I suggest you don't render all windows in the same loop, because it will lag.

What I do in my games is render each window separately, so if I have 4 windows, it will render the 1st in the 1st loop, 2nd in the 2nd loop, 3rd in the 3rd loop and 4th in the 4th loop, and then render the 1st one again in the 5th loop and so on. The object rotating will rotate as fast in 100 windows as in 1 window, but the frame rate per window will decrease, so with 100 windows, each window would only be updated every 100th loop...

Actually, I got that from Latch... So thanks latch!

Anyway, here's the code:



The windows leave an ugly trail, but don't let that bother you. Click the "New" button to create new windows, and have fun!

TheComet


Make the path of your enemies easier with Waypoint Pro!
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 1st Jun 2009 19:50 Edited at: 1st Jun 2009 19:54
Hmmm this might actually work, cuz what i was going to do was only update the 3d if it was the top window. because if it's not on top then you arn't going to be using it so i figure that will save speed.

I would still have to show/hide all the objects and position the camera for each time it's updated. well actually if i only update the 3d on the top window then i would only have to show/hide the objects and position the camera when it changes the top window. this might be doable.

and if i use that Set camera view and only update the top windows 3d then i don't have to Paint the window and then update the bitmap(that takes the speed down, plus if they grab the title and move it then it's updating the bitmap twice every loop ?)

do you think it's needed? or even something worth working at

New Site! Check it out \/
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 1st Jun 2009 20:05
Actually, every time you call sync, the 3d view is updated - unlike deciding to paste or not to paste an image or a bitmap.

If you want to squeeze more speed out without having to delete the 3d objects and use backdrop off to clear the 3d window or use draw to front and cover the 3d window with a bitmap, use set camera view and size the 3d window to 1 pixel: set camera view 0,0,1,1 or something similar. Then you can check to see if you need to move the camera or change objects only when the 3d window is > 1 pixel.

Quote: "Actually, I got that from Latch... So thanks latch!"

Oh yeah, the 4 screen split example only using 1 sync. I almost forgot about that!

Enjoy your day.
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 1st Jun 2009 20:28
Quote: "Actually, every time you call sync, the 3d view is updated - unlike deciding to paste or not to paste an image or a bitmap."


That was my point, whenever the window is on top, i don't have to do anything to update it's 3d.

when it moves from the top, then i have to get a image of the current 3d screen and when it's not on top just paste that to the screen. the 3d scene would look frozen when it's not on top though.

that could pose problems also. because if someone has some moving thing on the screen and it's not the top window then it still moves. you just can't see it moving.

New Site! Check it out \/

Login to post a reply

Server time is: 2025-06-08 09:17:40
Your offset time is: 2025-06-08 09:17:40