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 / cant see complete matrix

Author
Message
frugi
16
Years of Service
User Offline
Joined: 6th Jul 2008
Location:
Posted: 6th Jul 2008 22:12
hi
i made a matrix like this:
make matrix 1,25600,25600,50,50
then i set the camera at the middle of the matrix at a high of 1000
when i start now i can just see a part of the matrixand the top of the screen is just blue.
it looks like in the picture in the annex.
when i move forward i can walk narmally through the matrix but always with that limited sight.
if i set camera high to 5000 i just see a blue screen
is there a way to solve the problems?

thanks for help

frugi[img]null[/img][img]null[/img][img]null[/img]
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 7th Jul 2008 06:30
What you want to use is the SET CAMERA RANGE command. Basically, to save system resources (and thus fps) the camera clips everything that is a certain distance away. This command changes that distance.

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
master programmer
20
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 7th Jul 2008 17:26
Along with the camera range, make sure the camera is above the matrix and not "eye-level" with it.

frugi
16
Years of Service
User Offline
Joined: 6th Jul 2008
Location:
Posted: 8th Jul 2008 03:25
i set the camera rage from 1 to 25600 now i can see the matrix compleatly
thank you
and sorry for the missing picture i dont know why its not there

frugi
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Jul 2008 16:39
Don't make the matrix that big!

Make it much, much smaller (small enough so you see it all without using the Camera Distance command).

Make Matrix 1,2500,2500,50,50

.. will look exactly the same - just scale the models that you use to match the smaller scale and move objects around in smaller steps.

Having it so big will introduce problems later on... trust me on this!

TDK_Man

frugi
16
Years of Service
User Offline
Joined: 6th Jul 2008
Location:
Posted: 12th Jul 2008 05:14
i think its a good idea by thinking about used space and game speed
but if i have to make the models and matrix as much smaller they will loose much detail doesnt they? secondly i want to create some maps that reach sizes of Battlefield 2/Battlefield 2142 maps (i hope you know the game; its not meant as an advertise i just need an example) if not i would just say the maps are big...
so i think i will reach sizes like this.
by the way: i didnt got much experience about walkng through matrices because i just used the trial version of DBC but i ordered DBpro yesterday .
at the moment i try to make matrix and objekts for every centimeter two pixels big.
my first map i will make until my DB is delivered is 20meters*20meters so it will be 4000*4000 pixels. i think thats ok.
but if you say 2500*2500 is a good size i see problems coming when i create maps of 1kilometer*1kilometer (20000*20000pixel).
but you got a solution didnt you?(i just can hope)

frugi
master programmer
20
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 12th Jul 2008 06:13
When you scale objects down they don't lose detail; just size. So if you scaled everything down into proportion with a 2500,2500 matrix, you would be able to still have an ungodly large map with everything still seemingly the same size because they are relative to each other.

frugi
16
Years of Service
User Offline
Joined: 6th Jul 2008
Location:
Posted: 14th Jul 2008 01:05
but smaller objects means smaller textures and that means less detail. thats what i wanted to say by "less detail". the objects itselves will just become smaller thats right
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th Jul 2008 03:10 Edited at: 14th Jul 2008 03:15
Quote: "but smaller objects means smaller textures and that means less detail. thats what i wanted to say by "less detail". "


You shouldn't think of 3d in terms of pixels. Let's say we have a detailed texture (picture) at 256 x 256 pixels. In the 3d world, this doesn't mean that you have to use only 256 x 256 sized obejcts. The 3d object is made up of points in 3d space. A cube, for example, might only have 8 different points. So how does a 256 x 256 pixel picture get put on something that only has 8 points? Bascially, the 256 x 256 picture is "stretched" over the 8 points based on the relationship percentage of each point to the whole 3d object. This is called UV mapping.

Without getting into great detail, think of a blanket that's put over a box. At each corner of the box, you put a tack in to hold the blanket in place. These tacks are the coordinates that the 3d world will use to map the 256 x 256 picture onto the 3d object.

In 3d, the object can be any size; it doesn't matter because the picture will always be "tacked" the same way. So if the object grows (is scaled up) the picture will be mapped the same way because the position of the tacks (UV coordinates). If the 3d object shrinks, it still doesn't matter because the the relationship of where the 256 x 256 picture is placed and tacked on the 3d object stays the same, and the picture will size with the object.

The 3d object's size is imaginary. The size is a calculation relative to the camera's position. If you shrink something, that means you'll have to get the camera in closer to it if you want the object to fill the screen. The object will still look the same as it did when it was bigger.

Now, the problem comes in with the front clipping plane of the camera. This is the distance to the camera that things actually start to be drawn. When you use the command SET CAMERA RANGE, you have to put in 2 values - a front value and a back value.

The front value is the minimum distance the camera can see. The back value is the farthest distance the camera can see. The front values smallest value is 1; it can't be any less. If your objects are too small, you'll never be able to get the camera close enough without passing the object, to see it properly. So the caution is not to make your objects too small.

This example makes a tiny cube. If you press the up arrow the camera will move towards the object. Once the camera is 1 3d unit away from the object, the object will disappear because the camera is too close:



Enjoy your day.
frugi
16
Years of Service
User Offline
Joined: 6th Jul 2008
Location:
Posted: 16th Jul 2008 00:19
i think i know what you mean

i am always thinking of playing a charakter i a FPS and going close to another charakter.

- in real you would see just the face if you move to another person until you "crash" -
so you stand very close to the other charakter

in a display mode of 1024,768,32 the head of the other charakter has to have a minimal size of 1024,768,Z for example

if i make a matrix 2500,2500,50,50 the head of a character will be neary as big as a half of the world

i hope i didnt missunderstood you

frugi
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Jul 2008 03:14 Edited at: 16th Jul 2008 03:17
I think I may have confused you even more!

Quote: "in a display mode of 1024,768,32 the head of the other charakter has to have a minimal size of 1024,768,Z for example

if i make a matrix 2500,2500,50,50 the head of a character will be neary as big as a half of the world"


No, and no. 3D and textures are not sized the same way. If you make a matrix 2500,2500,50,50 , let's say that 2500 means 2500 km. So if a male human's average height is 177 cm or 1.77 m then:
1.77 m / 1000 m = .00177 m or .177 cm

Even at that size, your textures will be ok, but, it is too small for the camera because the camera can only get as close as 1 3D unit.

Now treat 2500 as metres . Then we have a 1 to 1 ratio in metres so the height can 1.77 3d units. That's still a little small for the camera. It'll work, but if that's the size of a human, anything it's easy to get too small with other objects likes rocks, animals, etc. So what if we treat 2500 as dm ? That should be pretty good. That makes our height 17.7 for a human. This means treat each 3D unit as 1 dm .

No matter what size you make the 3D objects, the textures will look the same. If you have a 128 x 128 texture, it will look the same on the .177 height character as the 1.77 height character as the 17.7 height character.

So for theis example, setting the matrix to 2500,2500,50,50 and thinking of the 2500 as dm, you should be able to size your objects based on 10 3d units per meter. The textures will look the same - you do not have to change the size of the textures.

Do not think of 3D in terms of pixels. A pixel is not a 3D unit.

Enjoy your day.
frugi
16
Years of Service
User Offline
Joined: 6th Jul 2008
Location:
Posted: 16th Jul 2008 22:49
all right.
i always thought 1 3D unit = 1 Pixel
its a bit confusing with this 3D units because i programmed with visual basic, c++, 3d gamestudio and all are using pixels as units.

i wrote some example code to make my problem clear.
the cube i made is another character(177cm).
i placed the players eyes (camera) at 165cm.
walk to the cube and if you are very close to it you will see that you can see the utop side of his head (not very realistic because if you see somebody in his eyes at a distance of 1 millimeter you will never see his hair)

for the rest i thank you very much. it helped a lot


so here is the code:



frugi
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 17th Jul 2008 05:36
I think it depends on the model. In my opinion, your position of the eyes in relation to the cube may not be accurate. The eyes general fall in the middle of the face/head (of a human). Here's a picture of model that I scaled to 17.7 decimeters based on a 2500,2500 decimeter matrix. I moved the camera in close to it's face without clipping. The picture is attached.

Enjoy your day.

Attachments

Login to view attachments
frugi
16
Years of Service
User Offline
Joined: 6th Jul 2008
Location:
Posted: 17th Jul 2008 21:55
maybe im a freak
my eyes are 12 centimeters under my hair so 177-12=165
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 17th Jul 2008 22:23
I doubt that!

Quote: "my eyes are 12 centimeters under my hair so 177-12=165 "

That sounds about right. The camera to the model's eyes in the pic I attached is at about 163 centimeters (not that it's proportions are correct to a human). I think it's harder to guage with the cube - though it gives a rough idea. All in all, if you are trying to make your 3d world just like the real world, it could be a bit tricky. You can make some good approximations. Once you decide on a size factor and scale everything relative to each other, you should be ok.

Computer 3D of course isn't the real world and the 3d camera isn't a set of eyes. You can change the field of view of the camera and everything will distort.



Enjoy your day.
frugi
16
Years of Service
User Offline
Joined: 6th Jul 2008
Location:
Posted: 17th Jul 2008 23:13
if i paste the code i get just a blue screen...
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 18th Jul 2008 00:49
Really? Don't know why... it should be a cube on a matrix stretching away from the camera...

Enjoy your day.
frugi
16
Years of Service
User Offline
Joined: 6th Jul 2008
Location:
Posted: 18th Jul 2008 23:09
oh... i just didnt wait long enough
i wrote my own code but i dont understand what it does...



for me it looks just like moving forward and backward
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 19th Jul 2008 00:05
The field of view is how "wide" the camera lens angle is. The default is around 62 degrees or in radians, 3.14/2.905. As you widen the fov, everything in the 3d world scrunches in towards the center to fit into the wider angle and the view elongates. When the fov get's smaller, everything moves away from the center and the view shortens (that's one way of making a zoom or something like a rifle scope in a game).

Anyway, the whole point of what everyone has written is, try and keep the size of your 3D world down and scale everything relative to each other. Don't make things too small or you won't be able to see them. If you try to make things behave like in the real world, you'll have to make some compromises and play around with the sizes until it looks the way you want or can live with. Pixels do not equal 3D units and vice versa. Textures will scale as the size of the 3D objects scale.

Enjoy your day.
frugi
16
Years of Service
User Offline
Joined: 6th Jul 2008
Location:
Posted: 19th Jul 2008 01:46
i made a picture to download below
thats how i understand camera fov now
there a two theories shown devidet up by the red line

i become totally crazy about that

Attachments

Login to view attachments

Login to post a reply

Server time is: 2025-06-07 06:57:31
Your offset time is: 2025-06-07 06:57:31