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 / DBP using sky spheres

Author
Message
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 16th Jan 2011 06:47
Ive been trying to get a sky sphere to work in my program and I am having little success, here is the code i have so far...

[
backdrop on


load image "media\ss1.dds", 1
load image "media\ss2.dds", 2
load image "media\ss3.dds", 3
load image "media\ss4.dds", 4
load image "media\ss5.dds", 5
load image "media\ss6.dds", 6
load image "media\space station.psd",7
load object "media\ss.x",1
texture object 1,1
scale object 1,40,40,40
set object cull 1,0
position object 1,camera position x(0),camera position y(0),camera position z(0)

do
control camera using arrowkeys 0,1,1
loop
]

how do i apply all the textures to the inside of the sphere?

Sometimes I like to use words out of contents
Kript
13
Years of Service
User Offline
Joined: 16th Jan 2011
Location: Delaware, USA
Posted: 16th Jan 2011 20:50
camera postion x, y, and z are not legitimate pre-set variables, like mousex(), mousey(), and z are. You probably knew that allready though, lol. Um.....
gtg, lol.
Yahoo me!

Love Helping, anyone have any questions, mail me: elenerde@comcast.net. Or Yahoo me: davidelener@yahoo.com!
Let's Go Phillies!
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 17th Jan 2011 02:46
Quote: "how do i apply all the textures to the inside of the sphere?"

To get the texture to show up on the inside of a sphere, I used to scale it on the negative (i.e.: scale object 1,-40,-40,-40). However, when I used my own texture with your code and created a sphere in the code it textured it on the inside without doing that. Perhaps that is something that got updated in DBPro v 7.5. Since I do not have your media, I cannot say if maybe something is amiss with your "ss.x" model. If you want to post your media or email it to me, I can take a look at it.

I don't believe DBPro can load .psd files directly. You should change it to another format.

The code runs lightning fast for me. I would suggest that you control the frames per second manually:


Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 17th Jan 2011 05:53
Thankyou for your responses.

The ss.x model is straight out of dark matters skysphere pack. its the space station one.

in the dark matter browser the skysphere works fine and has all six of the textures in place.

I copied the model and the textures into my project and all i can get is the one selected texture wrapped around the sphere.

i'm wondering how to get them all in there.

I could use a box to load the textures, but there is a way to get them all in a sphere and I'm stumped as to how.
I'd like to know how they did it.
Thankyou

Sometimes I like to use words out of contents
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 17th Jan 2011 14:29
The ss.x sphere was created in a 3D modeling program. They textured the inside of the sphere with the different textures. From what I have seen, DBPro sometimes has trouble assigning the textures to a model, especially when using .dds files.

You could load the model into a 3D modeling program and try and edit it yourself. Here is a link to some 3D modeling programs (scroll down a little bit):
http://forum.thegamecreators.com/?m=forum_view&t=154983&b=3

Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 17th Jan 2011 21:03
As LBFN says, the sky sphere was designed with the textures already positioned and the polygons facing the interior. If you just load the model, and DON'T load the textures, and DON'T texture the model, does it appear correctly?

Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 18th Jan 2011 13:06
This is a quick response without having read every post, so forgive me if my answer is useless to you, but...

To make a skysphere just MAKE OBJECT SPHERE with a *negative* size, which puts the texturable surface on the *inside*. Then texture it as normal with your sky.
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 18th Jan 2011 13:43 Edited at: 18th Jan 2011 13:46
@Agent - Good grief, there's only six posts, and the first one makes it plain that he has six textures.

BTW, that ".psd" file is most likely a photoshop file with all six of the images in it.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Jan 2011 13:59
I would say you might be best exporting the X object to the same folder as the textures (How: Depends on what you made it in...) so that when you load the object it loads the textures in too.

Otherwise it gets complicated.

Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 18th Jan 2011 18:36 Edited at: 18th Jan 2011 18:40
Problem solved! Turns out I had the Dark Matter, so I was able to look at the space station sky sphere.

The space station sky sphere comes in two versions, one is in a folder chain starting with DB and one is in a folder chain starting with 3DS. Both have sub-folders going SkySpheres>space station. But... the DB version has the textures as .DDS files. The .x model itself calls for .BMP files. The 3DS version has the correct .BMP files, which I think the Dark Matter browser loads.

So, with the model and all the .BMP files in the same root folder as your .EXE file, this code works...



It's simply a matter of having the .BMP files (NOT the .DDS files) in whatever folder your model is in. You can put them all in a media\ folder, just make sure they are all together.

You can adjust that code to have your sphere move to follow the camera position. The stars are hard to see, but that code DOES work.

Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 19th Jan 2011 01:21
Quote: "@Agent - Good grief, there's only six posts, and the first one makes it plain that he has six textures."


Yes, I know, but I was in a rush and this sort of question arises frequently. I can see now that my post was unhelpful, but it might not have been. It hurt nobody to put the quick thought that I had to paper.

I'm glad you sorted it out.
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Jan 2011 02:11 Edited at: 19th Jan 2011 02:11
Normally when we make a skybox with a box, we need six textures, but if we do a skysphere, we only need one texture.This texture can be generated by any 3D program.All 3D programs,can texture the objects, flat cylindrical or spherical, but it isnĀ“t the same as the commands used DBPro.In order the texture is applied with the desired effect, it need to be a seamless texture.If we want to see the texture on the inside face of the sphere I would do with set object cull obj,0 for example.

In 3D Max , there is a command, that convert a box in a sphere, keeping the six textures as if all them was just one, if we render to texture we can see how the texture will form the sphere.

Here is an example of a flat texture applied to an esphere.




Cheers.

I'm not a grumpy grandpa

Attachments

Login to view attachments
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Jan 2011 02:18
Here I let you the code complete, and you can see that the textures are stranges, but it must be a pogram that will generate it unless we want to brake our brains.

Cheers.

I'm not a grumpy grandpa

Attachments

Login to view attachments
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 2nd Feb 2011 03:18
Thankyou all for your help. I've got the sky sphere going. in the end i saved the psd file containing the whole panorama as a jpg and texturing a sphere with it.

Also thanks for the help with the file types i know now to convert dark matter skysphere image files to bmp to get them working.

Your help is greatly appreciated
thanks again

Sometimes I like to use words out of contents

Login to post a reply

Server time is: 2024-11-23 03:18:46
Your offset time is: 2024-11-23 03:18:46