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.

Dark GDK / Skybox help required.

Author
Message
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 7th Aug 2009 09:43
Dear all,

I have switched over to DarkGDK from DBpro, I now use this as my primary tool to code. I love the refernce guide that comes with it, and it has helped me a lot until now. Another reason for the switch, is the compilation to .exe seems easier, but havent got that far yet.

Okay, my problem is I cant seem to get the sykbox.x file recognised my DarkGDK, I think I need to recode it somehow to be accepted by DarkGDK, as its currently coded for DBpro where everything worked fine. I dont know how to do this... Also I attempted to use code from other tutorials, but this didnt work, and I feel this is due to the .x file being in an incorrect format. Does this seem logical?

Also if possible, a code snippet for the basic loading of the skybox would be handy too. I posted this as I did already try looking for another post but didnt find any that help this situation, so Id be very apreciative of any help to achieve this goal.

I look forward to any comments.
Adam
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 7th Aug 2009 16:05
Any file, either an object(.x .dbo), image, sound or music or whatever that loads into dbpro can be loaded into GDK aswell...

I think the problem might be with your code itself, using DarkGDK means that you need to know C++, at least well enough to program in a structural method on its own without GDK, you dont need to worry about the more advanced features such object orientented programming techniques and such to be able to use DarkGDK, but knowing the language itself is needed.

If you can, could you post the code you are using at the moment to load your skybox, that way its easier to see whats going wrong.

If it ain't broke.... DONT FIX IT !!!
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 7th Aug 2009 22:37
Mista Wilson,

Certainly, Its on my computer at my apartment, and I will send it as soon as I can. Ive used the tutorial code program, and built up my program from there, using the reference guide to help me with commands.

Im at work so it will have to be later, but I know it contains the 6 .jpg images and a SKYBOX.x text document.

Also Id like to know if there is a really simple way to make a very simple skybox or sphere, using as least instructions as possible?

Thanks for your reply
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 8th Aug 2009 05:04 Edited at: 8th Aug 2009 05:11
OK here is the main program, Im not sure where im going wrong with it, id like to know.


Thats the main program, its pretty simple so far.


and il include the skycube.x now, it looks not right... but thats me.



Hopfully someone can make some sence of it.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 8th Aug 2009 05:42 Edited at: 8th Aug 2009 05:43
You .X file has it's textures hardcoded into it, so you will need to make sure that the textures you are using on it are named correctly or it wont load them.

These are the lines responsible for the textures :



You can alter the file names of the textures you are using to match the ones in the .X file or you can edit the names in the .X files to match the ones you are using.

Also, your skybox, you are scaling it up by 30,000 , so its going to be quite large, I think you will need to extend the range of your camera to be able to see it.. the command to change the camera range is :



Have a look in the docs about it's usage, it has overloads so can be called in a couple of different ways. Maybe though, you could try not scaling the skybox so much, just to make sure that it's loading and displaying properly, then slowly increase the size until its the size you need it at...

If it ain't broke.... DONT FIX IT !!!
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 8th Aug 2009 15:22
I will give this a try, thanks
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 8th Aug 2009 15:40 Edited at: 8th Aug 2009 15:41
Im still haivng difficulties, and the filenames in the .x are valid. Is it a problem if my skybox files are in the source directory like with my grass.bmp? that texture seems to work ok. Il continue to have a play and see if i can get this working.

My second question is if I fail to get this to work, is there another way I can get the skybox to work?

thanks for your help.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 8th Aug 2009 16:00
Try copying one of the skyboxes from the DarkGDK samples folder, I think the Terrain demo has a simple skybox model and textures.

If you copy the .x model and it's 6 textures to your project's main folder and load the model in your code, it should texture automatically. I guess that will tell you if it's a problem with your model or not..

The alternative is to make a primitive(a cube or sphere depending on your textures), and manually texture the images onto it. I think there is a DBPro example in the codebase about applying different textures to a cube's individual faces. The last thing you would do after you have it textured is to negative scale it.. you will essentially be texturing it's outside, so negative scaling it will make it "flip" inside out and be textured on the inside(you may need to initially texture the object upside down, as when it flips it will invert the image) .. to neg scale it you would call something like :

dbScaleObject(1, -2000, -2000, -2000);

If it ain't broke.... DONT FIX IT !!!
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 8th Aug 2009 16:02
CURED, finaly got it to work, the problem was this line of code, and not the .x at all.



I then changed it to this...



This allowed the cube to be textured and it works!

Thank you all so much with your help.
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 8th Aug 2009 16:05


Not bad eh?
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 8th Aug 2009 16:08
Im glad you got it working... are those sky textures from cloudwright ? they look simply WOW !! to me lol

Just asking, cause I think I have a similar set of cloud images from a cloudwright demo somewhere on my pc hehe, they really do look nice.

If it ain't broke.... DONT FIX IT !!!
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 8th Aug 2009 16:17
I have to give credit to Softwizz for pointing me in the right direction, he got the basics for my map to work. I still need to make a minimap of some kind becuase if i can get my map to scroll correctly, it will feel like your walking around a globe, and the player may soon be lost...


In this instance the skybox should be referenced to the players position, and follow the player. or just made stupidly large

Yeah I love the way it turned out too. I also found a very tastey grass texture that has gone really well.

Il upload the skybox files I used so you can expereiment if you desire. Please find the .ZIP file attached. enjoy.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-10-06 07:35:13
Your offset time is: 2024-10-06 07:35:13