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 / Blender Model crashes graphics card

Author
Message
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 12th Jan 2008 12:12 Edited at: 12th Jan 2008 12:17
Hey guys!

I have made this model with Blender and it seems to make my graphics card go crazy and show up weird colors. Maybe it`s just my computer, I don`t know. I would be greatful if you could test it for me.

(File attached)


Here`s the code I used to view it:



Oooooops!!! I accidentally formated drive c.

Attachments

Login to view attachments
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 12th Jan 2008 15:34
I don't have any problems with the model... though there are a couple of things you may want to try.

Open the .x file in a text editor like notepad or even DarkEDIT if you have it installed. I see a problem at the very top. There is a missing Header template. Try changing:



to read:



or to read:


The 0032 or 0064 refers to the precision of the float values contained in the file. 0032 should suffice since that is the size of DBC floats, but 0064 shouldn't hurt anything.

If that doesn't seem to do the trick, on top of changing the header as I suggested, try erasing all of the template definitions at the top:



These are used for bone and skin mesh deformation (i.e. animation using bones) which DBC doesn't support.

Alternatively, you could use the python script I wrote a couple of years ago to export Blender objects to a Direct X file that is compatible with DBC. It also allows the type of animation that DBC can use. Here's a link to the website:

Blender to DBC

I haven't updated it (the script or the website) in... well ever I think. I haven't tested it with the newest release of Blender so maybe some of the python commands are antiquated or deprecated. Somewhere I do have an update to the texture UVs... I'll dig around.

Enjoy your day.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 12th Jan 2008 18:06
No, it won`t work. In a thread I started in the past, you said you have DarkBasic v1.2, where I have v1.13. Could it be the different versions?

Oooooops!!! I accidentally formated drive c.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 12th Jan 2008 19:13
Quote: "In a thread I started in the past, you said you have DarkBasic v1.2, where I have v1.13. Could it be the different versions?"


Even though I have 1.20, I use 1.13 because I don't have to make all the adjustments for lighting and text (and there are problems with 1.20 and win32 api that I keep running into). The version of 1.13 I have though is from 2002 I think... I heard the 2006 or 2007 1.13 had a few problems. Anyway, I tested it both in the DBC editor and in a model browser executable I made with DB and your model worked (a pyramid right? with two spheres etc) in both.

Try this attachment- this is your model file with the adjustments I suggested.

Enjoy your day.

Attachments

Login to view attachments
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 13th Jan 2008 05:38
Hey Latch,

I've been using that exporter script a while now. It works great, except the textures always export flipped so that however they get UV mapped in blender, I have to go into a paint prog and flip the image vertically for them to load properly in DB, any ideas?

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th Jan 2008 12:40
@Ortu
I really should rewrite that script. I've learned a lot since I originally wrote it!

Quote: "I have to go into a paint prog and flip the image vertically for them to load properly in DB, any ideas?"


A blender user named hyperion made a suggestion last year that seems to work. I'll assume you mean the python script I wrote and not the one included with Blender as I tell you the change to make.

Open the python script in a text editor. You can use the editor in Blender. If you do, make sure the line numbers are set to be visible. Look for line number 457. It should read:



Change it to read:



This should do the trick, but I haven't tested it enough to say it's 100%.

Enjoy your day.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 13th Jan 2008 17:05
@ Latch

You know a lot about exporting and x-files and you got me interested.
How did you learn that and how long did it take?

Oooooops!!! I accidentally formated drive c.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th Jan 2008 23:34 Edited at: 13th Jan 2008 23:36
@TheComet
Thanks for the compliment, but I still have a lot to learn!

Quote: "How did you learn that and how long did it take?"

There's lots of info about the DirectX format on the internet. If you were to research it, for DBC, look up DirectX 7 . How long it takes to learn is relative. That depends on study habits, how fast one picks things up, how much knowledge of the subject one has already, etc. For me, I gleaned what I needed pretty fast, but what helped even before knowing the file format was learning what a face is in 3d, how the vertices relate to it, and how normals are calculated.

Direct X file format is very flexible but it also can be unforgiving if you forget any formatting details. The file format is heirarchical and references are made to templates (objects) within the heirarchy. The order of objects can be switched around but I find the following order to be the easiest to deal with and to yield the most predictable results:



That's really all you need. The information in between are the names of the objects, numbers for vertices, face indexes etc. in the proper format. There are a lot more templates, and like your model that you attached, you can define what kind of information the templates will hold - like skin weight for example. For DBC classic, you don't need to define any templates and can use the ones (already internally defined) I laid out in the sturcture above. But feel free to experiment as you learn by adding other templates.

Enjoy your day.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th Jan 2008 17:32 Edited at: 14th Jan 2008 17:33
Wow.

@ Latch
In the original file I put up in the first post, I says:



instead of



And you always made it " xof 0302txt 0032"

Does that make a difference?

I mean, how come Blender exporter a "3" instead of a "2" ?

Oooooops!!! I accidentally formated drive c.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th Jan 2008 20:49 Edited at: 14th Jan 2008 20:53
That 0302 is the major and minor version number. 03 major, 02 minor. It's used for version and data checking. However, I've never seen it higher than 0303. I don't think it will make much difference, but I originally learned to use 0302 and it works, so if it ain't broke, i don't fix it! Why wouldn't it be the current directx version? you may wonder. I'm not quite sure. What I read once (and I don't remember the source) was that the current d3d direct x file format was developed as of direct x version 3 . Version 3 established all of the consistent templates and layouts that are still used today. As additional templates are added to the list, the minor version is increased.

Perhaps the default blender export uses 0303 because it is including the mesh deformation templates which were introduced in DirectX 8 or 8.1 (8.1 was considered a directx revolution by some).

By the way, did you ever get your model to load?

Enjoy your day.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 18th Jan 2008 22:48 Edited at: 18th Jan 2008 22:57
@ Latch

finally, I can download your script for blender...

I put the file in ~/.blender/scripts but it just exports with the blender exporter... how do I make it export with your script?


Quote: "By the way, did you ever get your model to load?"


No, it still won`t work...


TheComet

Oooooops!!! I accidentally formated drive c.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 21st Jan 2008 21:30
The instructions are on the website. Basically you have to load it into blenders text editor and press ALT+p .

Enjoy your day.

Login to post a reply

Server time is: 2025-06-02 10:13:40
Your offset time is: 2025-06-02 10:13:40