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 Professional Discussion / DBPro is imperial?

Author
Message
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 21st Nov 2012 10:56
Amazing how you learn something new every day (or remember something that you'd forgotten)! I've been figuring out some terrain commands (and what the hell is up with the missing help & ini terrain command data!? That's a different thread though...) and I started creating some mesh shapes in my 3D software, sized 1000mm^3. I then compared the DBPro cube to one of my shapes, and after a little trial and error have discovered that DBPro size units are in imperial!

Is there a switch to change DBPro to metric? Although it's not the end of the world, it just means I'll have to build my models using imperial templates, which is frowned upon here in Australia.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 21st Nov 2012 12:54
how about making your own cm/inch converter? its all possible when you know how to program

Advanced Updater for your games!
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 21st Nov 2012 20:31
I understand that it's all possible to convert 1 millimetre to 0.0393700787 inches, but I was curious if there's a switch to simply make DBpro metric, as not to have to scale every model I process.

No doubt the only way around this is for me to create a pre-processor for the models I use, or as I said originally, change my templates to imperial (ewww).

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 21st Nov 2012 21:22
nope. but u can use this functions:



use it such as:
make object box 1,CMToDBP(40),CMToDBP(167),CMToDBP(40)
//body width is 40, and height is 167 cm.

Advanced Updater for your games!
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 21st Nov 2012 22:28
That sounds very bizarre. When I export a model from Milkshape of 1 unit size it is 1 unit size in DBPro. Are you saying both Milkshape and DBPro are taking model data and scaling it to an imperial representation? How are you coming to this conclusion?

Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 21st Nov 2012 23:58
I use a modeling package called Autodesk Inventor, which is geared towards engineering, digital prototypes etc, but secretly I use it for my game dev hobby too .

The metric files at 1,000mm^3 I create via Inventor that I then export to 3DSmax, then export to Wings3D, then to the .X format all need to be adjusted by 39.3700787, which is metres to inches.

I've attached a .X example. On a slightly different note, does anyone know how to stop the .X file mirroring on export from Wings3d? It's a real pain in the butt. =\

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 22nd Nov 2012 12:28 Edited at: 22nd Nov 2012 12:34
Why do your model files need to be adjusted? Do you mean you're expecting your 1000mm^3 model to come out at 1x1x1 DBP unit in size and it isn't?

That's interesting, but I don't think it means DBP is in imperial units. DBP doesn't have a concept of metric or imperial units. There is no measurement of real world distance in graphics rendering. A distance of 1 is an abstract concept with no correlation to inches/mm. What DBP does is loads up your model file, reads a vertex position (0,1,2 for example) then render it at it's own 0,1,2 unit position.

I suspect either Autodesk internally defines a metre as 1/39 units in it's file format, or one of your model conversion steps is resizing it.

Quote: "I've attached a .X example. On a slightly different note, does anyone know how to stop the .X file mirroring on export from Wings3d? It's a real pain in the butt. =\"


Look for a left/right handed matrix/coordinate system option. If there is one, switch it the other way!

Dar13
18
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 22nd Nov 2012 15:23
DBP as far as I can tell is neither imperial nor metric, it all depends on how your game treats a single unit. In your example, your base 1-to-1 unit ratio is 1 DBP unit to 1 inch. If the rest of your game is not in the same scale, then it'll look weird.

Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 22nd Nov 2012 20:44
In saying that I think DBPro is imperial, when I

make cube 1, 10

It comes out an an imperial size, in comparison to a model that was built at a metric scale.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 22nd Nov 2012 21:03 Edited at: 22nd Nov 2012 21:05
There is no imperial or metric in graphics rendering. Think of it as a chess board. It doesn't matter how big the chess board is, all measurements in chess are squares left/right or forwards/backwards. When a model is imported, it's vertex positions are stored as these moves, and DBP simply positions them on the chess board. So if you import a model with a vertex is position 10x10x10, that's where it'll put it. No concept of metric or imperial is included.

If a box model you import has vertex positions between 0,0,0 and 10,10,10 it'll be loaded up the same size as a dbp cube made using MAKE CUBE 1,10. What's happening is the models you're importing are smaller or larger. You may be making a cube with 10m x 10m x 10m in Autodesk, or maybe 10mm x 10mm x 10mm but it's not exporting the model with vertex positions 10,10,10. It's exporting something else. Either that or one of your other programs is resizing it.

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd Nov 2012 21:39 Edited at: 22nd Nov 2012 21:44
@Burning Feet Man
I think Autodesk's default units are inches and when you change the default to mm, it processes the conversion in the saved file. So by default 1 3D unit in Inventor is 1 imperial unit. When you save your object as metric, the units are converted. When you load that file/object into another 3D app, you are getting the conversion result.

3D points do not correspond to any standard weights and measures. They are just points on a grid.

In the case of your 3D app, it is geared towards the possible printing and layout of engineered models to scale so it has built in conventions to portray drafts in real world measurements.

Enjoy your day.
Xsnip3rX
19
Years of Service
User Offline
Joined: 20th Feb 2007
Location: Washington State
Posted: 22nd Nov 2012 22:21 Edited at: 22nd Nov 2012 22:21
^ i wish i could like the post above this one
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Nov 2012 22:35
Is it April 1 already?



Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 23rd Nov 2012 04:52
So in reading all of the above;

3D space is effectively unitless in both DBPro & Autodesk Inventor (and other modeling packages). Within Inventor, upon employing metric sizes, Inventor then applies a scale to suite metric dimensions, eg, millimeters & metres.

Considering when I export an imperial sized cube from Inventor, and it's the same size/scale as a DBPro "Make Object Cube", to me this still indicates that DBPro is imperial.

Green Gandalf, why April Fools? I'm legitimately curious, or is my question that... dumb? >_>

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 23rd Nov 2012 04:59
Quote: "Considering when I export an imperial sized cube from Inventor, and it's the same size/scale as a DBPro "Make Object Cube", to me this still indicates that DBPro is imperial."


Who's to say that the quantity of units Inventor uses for its sizes is the universal scale for metric/imperial representation in 3D graphics?

You're signature has been erased by a mod
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 23rd Nov 2012 08:28
Quote: "Considering when I export an imperial sized cube from Inventor, and it's the same size/scale as a DBPro "Make Object Cube", to me this still indicates that DBPro is imperial."


Head + wall + bang.

It's all Inventor. It's Inventor that is choosing that 10inches = 10 3D units, and that 10mm != 10 3D units. Therefore if anything is working in imperial by default, it's Inventor.

Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 23rd Nov 2012 10:23
Fallout, did you download my .X file and have a look? It 3 cubes, one 1 foot, one 1 metre and the other one inch. Compare that model to the DBPro Make Cube, rather than banging your head (or mine?).

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 23rd Nov 2012 12:18
Yes. Your box of 1 inch correlates to 1 3D unit in any 3D modeller or engine. Not just DBP. I can open it in UU3D and Milkshape and both of them display the 1 inch cube as 1 unit long.

You .X file is an ASCII .X which makes it easy to look at what is actually stored. Because of the writing on the cubes there is a huge amount of data, but if you look at the end of the 1 inch cube frame data, you have a bunch of entries which correlate to it's extremities. e.g:

38.87107849121094, 1.001000165939331, -0.49899986386299133;,
38.87107849121094, 0.0010000815382227302, -0.49900001287460327;;

The cube is at approx 38 on the x axis. Then you can see it's lowest point on the Y is almost zero, and highest is just over 1. On the z the lowest is -0.5 and highest is probably 0.5.

So the cube is 1x1x1 ish in the file, so all 3D programs will open it and make the 1 inch cube 1x1x1. From that you can conclude either:
a) Every 3D engine/modeller is in imperial, or
b) They're simply interpreting the data in the .X file, and it's Inventor that is choosing to save a cube that it defines as an inch as a 1x1x1 file.

It's up to you. I am going to plump for b.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Nov 2012 12:32 Edited at: 23rd Nov 2012 12:34
Quote: "It 3 cubes, one 1 foot, one 1 metre and the other one inch."


No it isn't. Have you actually looked at your own x file? It's just three cubes with different dimensions plus a load of other random rubbish - no mention of feet, inches or any other units. What makes you think that your X file - or DBPro for that matter - knows anything about units? DBPro makes cubes using exactly the same unit sizes as those used in your X file. What on earth makes you think it doesn't?

I still find it hard to take this seriously.

Incidentally, why does your object need 960 vertices for just three cubes??? Clean your object up a bit then look at your X file (open it in Notepad for example) and then explain to us what you're on about.

Edit Plus what Fallout just said - and I'd opt for (b) too.



Seppuku Arts
Moderator
21
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 23rd Nov 2012 15:15 Edited at: 23rd Nov 2012 15:26
[edit] I missed one of Fallout's posts that explains it in a similar fashion to how I was explaining it.

In short.

The coordinates in the .X file as just coordinates relative to virtual space and those units aren't relative to real world space.

How these are to be interpreted is down to how the exporter treats the data. The export might choose that 1 inch is 1 unit or that 1 metre is 1 unit. Importers tend not to do that because an importer won't know whether that '1' is an inch or a metre or a yard or whatever. It'll just read it as '1' and that's where a vertex might be placed. Like putting a rook on B3 on the chess board (to use Fallout's analogy), the chess board could be massive (like on Harry Potter, with the wizard's chess) or it could be one of those tiny magnetic chess boards you might take on a plane, B3 will always be B3. Virtual space has no concept of real world space, we just apply it in 3D applications so we can make more accurate interpretations when creating our content.

Like in Photoshop too, you can have measurements in inches, centimetres and pixels. The computer will just read the pixels and when it saves, the picture will be read in pixels.

Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 23rd Nov 2012 15:23
Quote: "I still find it hard to take this seriously. "


I suppose if your main experience with 3D modelling is in a package which presents real world scales, you could make this mistake. Since we've all started out messing about with normal 3D packages where there are no units ... other than a unit! ... it may be more intuitive to us.

Quote: "Incidentally, why does your object need 960 vertices for just three cubes??? Clean your object up a bit then look at your X file (open it in Notepad for example) and then explain to us what you're on about."


There are a bunch of verts which create numbers/text on the bottom of each cube. I wondered why they were so messy too.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Nov 2012 16:13
Quote: "Since we've all started out messing about with normal 3D packages where there are no units ... other than a unit! ... it may be more intuitive to us."


Fair point.



TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Nov 2012 17:45
A modeller in my team uses Autodesk 3DS Max. Here's an interesting discussion I had:



TheComet

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Nov 2012 17:47
Quite.



Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 23rd Nov 2012 18:06 Edited at: 23rd Nov 2012 18:09
I can see how it'd be confusing. Here's another analogy I just thought up ...

Basically since 3D stuff doesn't exist, nor will it ever exist for real, actual size is completely irrelevant. It means nothing. It's like saying this list of 12pt letters in a document are 5 foot tall. That means nothing. It's just a list of letters with an abstract size. It's only 5 foot tall if you actually print it out and scale it so it comes out as 5 foot tall.

Actually ... pretty lame analogy!

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Nov 2012 18:34
Guys, guys, the analogy has already been established. Here it is:



Don't get it?



TheComet

Seppuku Arts
Moderator
21
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 23rd Nov 2012 19:09 Edited at: 23rd Nov 2012 19:11
Quote: "Actually ... pretty lame analogy!"


I preferred your chess board analogy.


Literally they're just made up coordinates and they have no 'real' size because they aren't real, they're just electronic. How you define those coordinates? Define them in a way that works for you, it'll make no difference to how the computer reads it. Like making your own chess board - it's up to you what the real world distance between B1 and B7 is, be it 6 metres or 6 centimetres, in the world of cheese it'll be 6 units, B2, B3, B4, B5, B6 and then B7. The chess pieces will still be the same scale as the board and it'll make no difference to the world of chess, nobody says "move the king pawn 10 metres forward" - the computer isn't going to think "10 metres ahead" either.

I suppose Comet represents the argument fairly, it's the difference in thinking about it as an artist - how you measure the size of your media so you have your own point of reference and the computer, who has no real concept of size or distance. Hence, all the metres and inches malarkey appears on the artist's 3D program but not the file format itself. The numbers mean whatever you like.

mistsnake
16
Years of Service
User Offline
Joined: 24th Apr 2010
Location: Inside the matrix
Posted: 23rd Nov 2012 21:08
size is all relative basically, you control the size of the model - use the same model to draw 5 different sized boxes on screen if you want. then you impose a conceptual size on it say a human and the size of the human to the boxes relates their sizes, add a texture map and you change that box to a building, a toy or a matchbox depending on size you made it to human.

db or other software is just loading the model on screen to a default see-able size, you particular software is just pretending that size is mm as a engineering program must show a item to a specific size as indeed any manufactured item must be shown as
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 23rd Nov 2012 23:26 Edited at: 23rd Nov 2012 23:32
Cheers Fallout! Your point B) makes sense and I now understand what's going on!

Green Gandalf, the cubes had the unit embossed onto them, 1 in, 1 ft and 1 m. Except they exported mirrored via Wings3D export .X format, which is a problem I'm yet to solve, thus the text came out in reversed.

Tah muchly to everyone else and their analogies!

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 23rd Nov 2012 23:53
Did you look for a handedness setting? If everything is mirrored it'll be something to do with left/right handed coordinate systems. I believe DBP uses a left handed system and most model programs use a right handed system. So look for a setting to choose that (or 'flip handedness') when you export.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Nov 2012 01:10
Quote: "Green Gandalf, the cubes had the unit embossed onto them, 1 in, 1 ft and 1 m."


What does that have to do with it? It's quite clear from the X file that the cubes have a certain size in standard DirectX 3D "units". If you, or the software you use, choose to interpret those 3D units as inches etc that is entirely up to you.

For example the very first vertex listed in your X file has XYZ coordinates



Those are the same XYZ coordinates that DBPro, and DirectX generally, uses - nothing to do with inches, metres, etc. Of course, other software might call those mm, cm, in, or whatever they want.



Stab in the Dark software
Valued Member
23
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 24th Nov 2012 01:51
My version of DBPro is US Standard not Imperial that's a British measurement that is obsolete.
To fix the export of a .x file from Wings 3d just flip your object on the x before you export.

[img][/img]


WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Nov 2012 22:05
This thread gave me a headache!

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 25th Nov 2012 07:50
I use feet and inches in my dbpro projects, only because the FPSC character models work out well that way, they are about 72 units tall which works out to 6 foot and gives me a realistic scale without having to resize everything.

Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 25th Nov 2012 10:06


Quote: "What does that have to do with it? It's quite clear from the X file that the cubes have a certain size in standard DirectX 3D "units"...

Those are the same XYZ coordinates that DBPro, and DirectX generally, uses - nothing to do with inches, metres, etc. Of course, other software might call those mm, cm, in, or whatever they want."


It's funny cause you answered your own question. The text on the cubes is to indicate what my Inventor package scaled them at. Since Inventor is my primary modeler, I was figuring out the best scale to use for my models.

I'm going to look into the left & right handed export options on Wings 3D now. I remember the last time I tried flipping on an XY plane, the model turned inside out.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 25th Nov 2012 10:40
Quote: "I remember the last time I tried flipping on an XY plane, the model turned inside out."

Did it flip the entire model as a whole? Or each poly separately?

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 25th Nov 2012 10:53
Quote: "I'm going to look into the left & right handed export options on Wings 3D now. I remember the last time I tried flipping on an XY plane, the model turned inside out."


If you do that, look for a "reverse vertex order" or similar option. Milkshape has this option which makes all faces face the other way.

Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 25th Nov 2012 11:57
Revisiting the Wings3D program, I can flip bodies prior to exporting to .X which then brings the model in correctly to DBPro. A few tricks can be done to combine bodies, flip, then separate multi-body objects so that the model flips globally (including each body position) too. I think it comes down to Wings3D lacking a Left Hand & Right Hand export toggle, as previously mentioned in this thread.

Attached is the .X model with the text flipped correctly for use in DBPro.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia

Login to post a reply

Server time is: 2026-07-11 12:57:13
Your offset time is: 2026-07-11 12:57:13