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.

Author
Message
Barbarian
17
Years of Service
User Offline
Joined: 11th Dec 2006
Location:
Posted: 30th Oct 2007 04:01
(i use dgdk, not darkbasic pro, but i think a darkbasic user could answer this too)

this may be a really really stupid question; but i don't understand, when a function refers to creating an object in 3d space (for example a box), what unit is it using for the dimensions/location?
aluseus GOD
17
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 30th Oct 2007 04:08
I personally having no experience in 3d, have no idea, but just so you know I 99.9% its in pixels or inches. Of course you could find out the scale.

This isn't a sig. It's me disguised a sig. Can you get me out?
Barbarian
17
Years of Service
User Offline
Joined: 11th Dec 2006
Location:
Posted: 30th Oct 2007 04:14
yeah, i was thinking it'd be in either pixels or inches, but i'm leaning towards inches, seeing as how most 3d design programs are defaulted to inches. anyway, if this is the case, is there any way to convert from inches to cm/metres without having to open up a calculator? by the way, my original question may seem a bit ambiguous, i am referring to creating the 3d objects through DGDK or DarkBASIC, not in 3ds max, blender or any other program suited for creating 3d objects.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Oct 2007 04:18
3D world units.

It's not using real world units like inches or centimetres because everything in your 3D world is relative.

For example, create a cube of size 1x1x1 3D units. Set your camera to look at it and say what size you think it is.

You can't as there are no other reference objects for your brain to judge it's size.

Now load a model of an ant, size it to appear half the size of the cube and place it on top of the cube.

Your brain then 'sees' a very small cube roughly twice the size of the ant.

Next, replace the ant with an elephant, make it the same size as the ant and place it on top of the cube.

Your brain now sees an enormous cube with an elephant standing on top of it - yet the cube's dimensions are still only 1x1x1...

So, the size of an object means nothing - it's size relative to other objects in the scene give it the appearance of size, so using fixed units of measurement are meaningless.

TDK_Man

Barbarian
17
Years of Service
User Offline
Joined: 11th Dec 2006
Location:
Posted: 30th Oct 2007 04:26
thanks for replying tdk, i distinctly remember reading one of your guides a while ago

anyway, the reason why i was asking is because the sample game "dark dungeon" included with DGDK has a map make function that i would like to copy. it first makes a 2 dimensional array containing all the map data where each character represents a different object (for example t may be tree or e may be an enemy) and uses nested "for" loops and a case statement to place each object. i wanted to use the same map system for my game but the problem is that each object has to be seperated by a constant amount, for example by 100 3d units, so the objects aren't overlapping.

so my problem is finding out what this value should be in 3d units, because each object should be touching the one next to it but not overlapping.

anyway, i hope you can understand what i'm talking about.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Oct 2007 04:42 Edited at: 30th Oct 2007 05:39
Quote: "so my problem is finding out what this value should be in 3d units"


You should have the equivalent of DB's Object Width(), Object Height() and Object Size() functions - they should help.

You could position them randomly and then place a hidden box around them using Object Size() to calculate the size. You then check for collision between the box and any other object and move the object a 3D unit at a time until no collision is occuring.

There are a other ways to do it too...

You could use a positioning system along the lines of having 2 dimensional arrays for each of the object types which you randomly fill with objects. You know the size of the objects in each array, so you transfer them to the game area using the correct separating distance.

TDK_Man

Barbarian
17
Years of Service
User Offline
Joined: 11th Dec 2006
Location:
Posted: 30th Oct 2007 04:54
never thought of that, thank you very much
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th Oct 2007 05:19
This can be such a pain in the rump. In my game - Iron Infantry - deciding how big to make the men near the tank - a chore - how big the heli - near the tank - near the man - a chore - it took a while - make the tank move not to fast - not to slow - same with the man - same with the heli. Once I had these figured out - I could kinda come up with MY OWN measuring ... like - Ok - 2 game units is 9 feet... or whatever it is/was.

Then I got all my bullets lined up, and positioned the guy when in the tank, all that jazz - but sound was acting really hosed - so were some camera jiggles I was getting.

Someone said "DUDE - when you have stuff that small - rounding errors and stuff might mess ya up"

So I made things Bigger - tanks now 6 units wide - (Note - some people - makes sense too .. make a game unit equal .. in their mind... a unit they understand - like a meter. then they size things so they look right near a "meter stick" or 3d ruler of some sort) then I had to realign the men, the bullets - because scaling the offsets I was using to line stuff up - was close - but not dead on correct.

Very Good Question and I like how TDK clearly pointed out its about what you see - or what you think you see - that gives it scale.

Note though - my point is that making things .5 wide - like a truck - might not be ideal for an FPS for example - sounds don't seem to position as well with small fractions - there is NO RIGHT answer - no RIGHT SIZE but (not just me) people have better results when things are a bit biger than .5 for say a truck.

One rule of thumb - is a unit a meter works well - but like TDK said - its relative. This 1 unit per meter is probably not a great idea for a space game. Your camera rnage would have to be set... um... yeah - I'm sure you understand

Good Luck!

Barbarian
17
Years of Service
User Offline
Joined: 11th Dec 2006
Location:
Posted: 30th Oct 2007 05:42
once again, thank you very much for the help. now i just need to work on getting the models

Login to post a reply

Server time is: 2024-09-27 08:34:48
Your offset time is: 2024-09-27 08:34:48