Measurement system

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
radiant
Posts: 112
Joined: Fri Feb 22, 2008 8:04 pm
Location: Mexico

Measurement system

Post by radiant »

Hi, currently in my proyect i need to implement a system to measure distance between 2 points, i already know how im goin to do this, i just need to know what unit does irrlicht uses when i call:

getDistanceFrom(vector3df);

inches ? cm? ft ? pixels @_@?

i made a test in order to probe this.... i made a 1x1x1 cube in MAX and got the distances between vertex.... but i just cant remember how to change MAX's distance units =P

either answer is welcome xD

Thanks in advance
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

max's units are under customization menu :)
radiant
Posts: 112
Joined: Fri Feb 22, 2008 8:04 pm
Location: Mexico

Post by radiant »

Thanks ^_^
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Re: Measurement system

Post by rogerborg »

radiant wrote:Hi, currently in my proyect i need to implement a system to measure distance between 2 points, i already know how im goin to do this, i just need to know what unit does irrlicht uses when i call:

getDistanceFrom(vector3df);

inches ? cm? ft ? pixels @_@?
Irrlicht works in Quatloos. If you're not comfortable working in Quatloos, convert to Firkins. There are 12.723 Qualtoos to the Firkin, except in leap years (which this is). Then the Firkin is replaced by the Spoogepuk, which is always expressed in an irrational base, using the Calvinball Conversion Paradigm.

Clear enough?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Post by Ion Dune »

arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

:D :D :D
i just need to know what unit does irrlicht uses
Actually Irrlicht uses ....just UNITS ...you decide what 1unit is.

cm? ...why not
m? ...if you wish so...
inch? ...as you please
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

arras wrote:
i just need to know what unit does irrlicht uses
Actually Irrlicht uses ....just UNITS ...you decide what 1unit is.
Quatloos! I HAVE SPOKEN!
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
radiant
Posts: 112
Joined: Fri Feb 22, 2008 8:04 pm
Location: Mexico

Post by radiant »

LMFAO........

OK.... i made a 1m cube in max..... loaded it in irrlicht.... got the bounding box.... and extracted all vectors in it.... and the distances from each other...
got the following result:

d(v0 - v1)= 1
d(v0 - v2)= 1
d(v0 - v3)= 1.4142
d(v0 - v4)= 1
d(v0 - v5)= 1.4142
d(v0 - v6)= 1.4142
d(v0 - v7)= 1.73205

Test 2..... the same bgut this time a 2m cube....

d(v0 - v1)= 2
d(v0 - v2)= 2
d(v0 - v3)= 2.8284
d(v0 - v4)= 2
d(v0 - v5)= 1.8284
d(v0 - v6)= 1.8284
d(v0 - v7)= 3.4641

test 3..... 1.5 m

d(v0 - v1)= 1.5
d(v0 - v2)= 1.5
d(v0 - v3)= 2.1213
d(v0 - v4)= 1.5
d(v0 - v5)= 2.1213
d(v0 - v6)= 2.1213
d(v0 - v7)= 2.5980

test 4: 15m

d(v0 - v1)= 15
d(v0 - v2)= 15
d(v0 - v3)= 21.2132
d(v0 - v4)= 15
d(v0 - v5)= 21.2132
d(v0 - v6)= 21.2132
d(v0 - v7)= 25.9808

well so far.... checks.... seems like irlicht uses meters...

but... not so fast... i changed units in max and used a 10 inch cube...

i wont bore u with details(might be too late already)... it matched te previus results... got .254 meters distance on each edge...

unless something very strange has happened in my tests.... irrlicht uses meters as units
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

very cool research man, this is helpful
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

This might be hard to wrap your head around, but Irrlicht does NOT use meters. It used UNITS. Any unit you want. You can have a cube represent the whole universe or just a molecule. It's your choice.

Once again: Irrlicht uses units
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yeah it really does just use arbitrary units and you can decide what they mean.

What format are you exporting from MAX? That may affect the way irrlicht interprets the units, you could look at the model loader for that format in irrlicht and see if it does anything with a units value read from the file and whether it then uses that to convert anything, or maybe it's just the MAX exporter changing things when it exports.
Image Image Image
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Re: Measurement system

Post by MasterGod »

rogerborg wrote:Irrlicht works in Quatloos. If you're not comfortable working in Quatloos, convert to Firkins. There are 12.723 Qualtoos to the Firkin, except in leap years (which this is). Then the Firkin is replaced by the Spoogepuk, which is always expressed in an irrational base, using the Calvinball Conversion Paradigm.

Clear enough?
If you speak Chinese. XD, wtf did you wrote there!! LOL!!

P.S
FTW..
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

radiant wrote:unless something very strange has happened in my tests.... irrlicht uses meters as units
To be serious for a second, and to echo what others have said:

What this demonstrates is that MAX uses meters as units, not that Irrlicht does so.

Specifically, Irrlicht doesn't care what the modelling tool calls those units. If MAX described a 15-unit cube as being 15 Quatloos in size, then it wouldn't mean that Irrlicht uses Quatloos.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
radiant
Posts: 112
Joined: Fri Feb 22, 2008 8:04 pm
Location: Mexico

Post by radiant »

Well.... they are just units... anyway... a 3d model is a bunch of points that makes lines that makes faces that makes solids....right? how does irrlicht knows where to put every point ? irrlicht uses vectors... 3Dvectors has 3 components... x,y,z in some units... if u start at 0,0,0 how far is 0,0,1 ?
this might be world size dependant... if u start at the origin.... how far can u go in irrlicht? this is very confusing..... damh Albert Einstein... so anyway....

if there are no units in irrlicht... if i put a cube from MAX wich is 1m per edge(max measures) and then i add another one made in say..... blender wich doesnt use a metric system.... how does irrlicht knows how big they are?

if there is no answer to this... anyone has any idea about how to implement a measurement system?

btw im using .3ds files from max
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

You must understand that you do not work here in real world space. Computer modeling, graphic and pretty much anything else is just dealing with abstract data. All consist of just 1 and 0. Is that 1 meter? That depend on you ...how you interpret that. Can be meter, man, your ant or Quatloon.

You did model your cube in Max as 1 meter large ...but that is just Max author who decided that 1 unit in Max is 1 meter ..or you by setting that somewhere in Max setup. If you decide that not 1 unit but 10 units are 1 meter and set it up somewhere in Max you will got 10 units large cube in Irrlicht no mater what Max says.

What you did discover is not that Irrlicht use meters but that Max interpret 1 unit as 1 meter to you. Try different modeling ap or change settings in Max and you might be surprised.

Units are totally abstract, you can use them as meters if you want, or cm or something else. You should just make sure once you make your choice to stick with that for rest of your project.
Post Reply