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 / Loading Model + Texturing it

Author
Message
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 8th Dec 2010 15:38
Hi. I've made model in wings 3d, made texture for it, and i dont know why when i try to load something with this piece of code:


It displays the model, but it's all black

Help needed

Cheers!

~Kamac
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 8th Dec 2010 17:14
Try using relative paths instead of absolute. If the game, directory is pulpit. Add media folder to that. Place the media file there. Then use this code.



Let me know if that helps.

Brian

Have netbook will travel.
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 8th Dec 2010 17:32
Well, now the code is:


I added these two files to media\ folder of my game, and it's still not textured .

Cheers!

~Kamac
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 8th Dec 2010 18:28 Edited at: 8th Dec 2010 18:35
Here is a example with your code. Using a barrel i have made. If this works it may be a file name issue. It may be your models normals or the texture file.

Brian

Have netbook will travel.

Attachments

Login to view attachments
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 8th Dec 2010 19:35 Edited at: 8th Dec 2010 19:36
Well, the texture is still blank. Here are the files

PS. I use wings 3d

PS2. Nvm, it works .

Cheers!

~Kamac
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 8th Dec 2010 21:51 Edited at: 8th Dec 2010 21:52
Sorry, my internet went down for a couple hours. Glad to hear you got it working. I use wings too. The barrel was made with fragmotion.

Brian.

Have netbook will travel.
Yudi
13
Years of Service
User Offline
Joined: 10th Dec 2010
Location:
Posted: 10th Dec 2010 16:53
I have made an object using 3d world studio and saved the file as 'idle.x' on my desktop

now when i try to load it in DBpro by using
load object "idle.x",2

I get and error message

runtime error 105 - file does not exist on line 4

can some1 pls help me out
Blobby 101
18
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 11th Dec 2010 12:00 Edited at: 11th Dec 2010 12:03
you're not texturing the object at any point in your code, you load the object using load object and the image using load image but this just stores the files in RAM so that the program can access them, in order to actually apply the image to the object as a texture you need to use texture object objectnumber , imagenumber.

Hope this helps

EDIT: Didn't realise you had fixed this!

Yudi, the files need to be in the same location as your EXE for you to be able to use local paths like that (IE. object.x), you should place the object files in your project folder and then it should work.

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 11th Dec 2010 16:22
Ah yes, black models normally mean you have tried to load a texture up but mistyped it. DB has an annoying `feature` at the moment where it will load up phantom images, even if they don't exist. For example:-

That will run fine and dandy, although no image called apple exists. You will get a black sphere. Normally it would flag an error and exit, but latest version of DB ignores and continues on. It is only an annoyance when you know, but if you are not aware you could spend a lot of time messing about wondering what is happening. I tend to put a "if file exists()" condition in these days just to have an error check in place. The same can be said for .jpg, but if you load in a .tga, it will flag it is missing. So obviously it's a change for certain file formats that has caused this.

http://s6.bitefight.org/c.php?uid=103081
Yudi
13
Years of Service
User Offline
Joined: 10th Dec 2010
Location:
Posted: 11th Dec 2010 18:50 Edited at: 12th Dec 2010 16:10
Thank you guys i was finally able to load the object.

Got a new issue now.
I have created a terrain in 3dworld studio.
How to i load the terrain in DBpro now ??

I tried Load Object"abc.x",1

But just a black screen is displayed
Please help

Login to post a reply

Server time is: 2024-11-23 06:56:51
Your offset time is: 2024-11-23 06:56:51