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 / Cubemap Separator

Author
Message
Digger412
17
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 27th Apr 2009 03:49 Edited at: 28th Apr 2009 03:20
Hello, I've been working on a program to separate the 6 images in a standard 4 by 3 cubemap. I've got nearly everything worked out, but after it finishes running and I open the images up, they don't seamlessly line up. Any ideas why?



I've attached the image that I've been using to experiment on. Thanks.

EDIT: Sorry, forgot to mention that you have to have the image in the same folder as the program for it to be able to see it.

EDIT2: Program fixed. Thanks, Sixty Squares.

EDIT3: Update, added repeatability to it. Working on finding ONLY usable images.

EDIT4: Repeatability added. Works with images of any size now. Thanks to Sixty Squares for all the help!

Attachments

Login to view attachments
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 28th Apr 2009 01:19
This probably won't help, but maybe try adding a ",1" to the end of your GET IMAGE commands?

<---Spell casting battle game!
Digger412
17
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 28th Apr 2009 01:34
Ahh, okay. I looked at the 'get image' command, but I forgot about the extra parameter. Works great now! Thanks!

Also, is it possible to use the 'get image' command outside of your screen area? I have a couple of 1024 by 1024 maps, but I can't use this with them because my screen only goes to 1280 by 800. On my first attempt, I tried to change the capture area, but ended up on moving the image instead because of my screen restriction. Thanks!
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 28th Apr 2009 02:51
Quote: "Works great now! Thanks!"

Wow, I'm suprised that worked

Quote: "I have a couple of 1024 by 1024 maps, but I can't use this with them because my screen only goes to 1280 by 800. On my first attempt, I tried to change the capture area, but ended up on moving the image instead because of my screen restriction. Thanks! "


Yes. You can use CREATE BITMAP, and create a bitmap of any size you like. If your image is 1024x1024, make a 1024x1024 bitmap. Bitmaps, in this case, can be thought of as new screens that the user can't see. When you use the CREATE BITMAP command, the current screen that things are drawn to becomes that bitmap. Thus, when you use any 2D command it is automatically drawn to that bitmap. This includes the GET IMAGE command, which will get images from the current bitmap. You can switch between bitmaps using the SET CURRENT BITMAP command, with bitmap 0 being the normal screen that the user sees. When you're done with a bitmap, you can use the DELETE BITMAP command to delete it. When a bitmap is deleted, if that bitmap is the current bitmap, then the current bitmap is reset to the normal screen that the user sees (bitmap 0).

Anyway, try using the create bitmap command, maybe something like this. Don't forget to delete it afterwards:

CREATE BITMAP 1,1024,1024
Paste Image 1,0,0
Get Image 2,0,0,1024,1024,1
DELETE BITMAP 1

<---Spell casting battle game!
Digger412
17
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 28th Apr 2009 03:18 Edited at: 28th Apr 2009 03:22
Haha! Thanks! I just added

create bitmap 1,imagex,imagey

at the beginning, so it doesn't have to check anything (didn't forget delete either ). It'll work with any size cubemap now. The cubemaps I wanted to separate were 4096 by 3072, with the squares being 1024 by 1024 each. I had set it to make a bitmap big enough for the entire image, but that took too long and too much memory, so I just set it to the square size (imagex and imagey). It still takes a while for the larger ones, about 9 seconds, but I don't blame it lol. Takes me about 5-10 minutes by hand if I work fast. I knew somewhat about bitmaps, but not that they could be used like that. Thanks a ton!
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 28th Apr 2009 04:58
You're welcome, I'm glad you've got it working . Making programs to do things for you can be veeerrryy helpful .

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
Digger412
17
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 28th Apr 2009 05:10
Oh yes . I'm separating the cubemaps to use them for skyboxes..I go into 3D Canvas, invert a cube, then texture the North, East, South, and West sides, the export it and load into DBPro. Easiest way IMO to make skyboxes.

Login to post a reply

Server time is: 2024-11-25 07:36:38
Your offset time is: 2024-11-25 07:36:38