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.

Newcomers DBPro Corner / Object Position On Screen

Author
Message
Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 22nd Oct 2011 01:10
Just a quickie 2 questions:


1) as you can see by the rem'd out cls's i cant seem to get the text to "print" and have the 3d objects too. Not sure why this is, anyone got any tips because i seem to remember being able to do this a short while ago and now i have forgotton.

2) If the object(1) - the cube - is at x position 460 then how come it is at x position 3384 and off the screen. Surely looking at it on a 640 wide screen means that only if the object were close up, like right up to the screen and at x pos 640 or more then it would be off the screen. The further back you go along the y axis the more the object has to travel along the world x axis before it goes off screen as seen as the 640 wide extends outward in its field of view across the world. Even if Object Screen does not mean what i think it means (its position in relation to the screen) then it should still be on the screen and seen wouldnt it?

This is baffling me a bit and im sure if it were cleared up i would have a better understanding of some 3d things.
Darkzombies
13
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 22nd Oct 2011 03:17
Print doesnt work too good in these cases, try using text. If that doesnt work, then I dont know.

t is s gnat re h as ben destro ed by A m d
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 22nd Oct 2011 03:45
The Text Command will work. Print will work as well, but you should set the cursor first. The 3-D X coordinate does not correspond to the screens X coordinate. X position 3384 is where the object would be on the screen. This example should demonstrate. Use the down arrow until the cube comes into the field of view. The up and down arrows will move the camera on the Z plane. Notice how the objects X position changes as you move the camera in and out.

Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 22nd Oct 2011 14:03
The set cursor thing was what i was looking for, thanks.
I am still confused though. I though the x position was left to right. If we are moving towards and away from the object then wouldnt only its z position change as its still dead centre in relation to the camera at least for its x and y positions. Anyone got any diagrams showing whats going on?
nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 22nd Oct 2011 21:29
Breakdown:

2D: Coords are relative to the screen, the screen is the world.

3D: Coords are relative to what they call the "world". Think of it as a warehouse and you are the cameraman. The screen is your camera. You are moving the screen relative to the warehouse's coords. You are also able to move objects like boxes but again, they are relative to the warehouse's coords. The screen doesn't have to "see" this happen. If I am a box and you are looking at me, my left and your left are 2 different sides. That's why this can happen in the world of 3D. I move to my left, looks to you like I'm moving right.

Hopefully this clarifies the concept a little.

Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 23rd Oct 2011 00:06
@nonzero - Yeah i kind of get the concept of the camera viewpoint. Also its viewpoint sides not quite being directly strainght forward as with any camera it 'V' shapes out from the source till it reaches the distance it can no longer see anything. But if the boxes movement is based on its face and its faceing me the camera i can see why it appears at opposites.

So in the above example it is just a case of camera position in relation to the object which was throwing me off a bit. Because surely even in 3d space the x axis if you were facing 0,0,0 would be the left to right one. If this is the case then i get it.
Thanks guys.
nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 23rd Oct 2011 21:02
If the camera was centered perfectly within the 3D space, facing the center and at a place on the Z-axis that was (relatively) appropriate to make it so, then X-axis would go left to right, Y-axis would be top to bottom. But you must remember that there are three points of "relative" in this scenario:

1) What's relative to the 3D world space.
2) What's relative to the Object (me, the box )
3) What's relative to you, the observer.

Let's assume for a moment that the camera is frozen. If I'm facing you, my right is your left. If I'm facing away from you then my right and your right are the same. Now here's the thing. In 3D animation, you get different commands that move the object relative to different things.

In a 3D environment, each axis is where it is, regardless of anything else. So in a sense, when you move something, you have to think beyond what you see. It'd be a good idea to familiarize yourself with the concept of 3D first. Then learn about creating and manipulating cameras as this is a very overlooked but very important part of 3D design. Bad cameras can ruin a game. Also, learning about cameras will better your understanding of 3D space. Don't be afraid to look at some tutorials either. They are very helpful and with 3D-understanding, you don't necessarily have to look for DBPro tutorials as anything explaining 3D itself would help.

Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 23rd Oct 2011 21:37
Thank you for your input nonzero. I am currently working through my Hands on Dbpro volume 2 book which covers 3d, while i am also bouncing around doing all sorts of things at once so i dont get stuck on any one thing too long. I will see what the book teaches me, then i will move on to searching any tutorials on here that are 3d camera based (do you have any links to any particulalry good ones?) and see where i can go from there.

Thanks.
nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 25th Oct 2011 15:46
Quote: " (do you have any links to any particulalry good ones?) "


Can't think of anything in specifics. One thing you could do is play with Google Sketchup. It'll get you thinking in 3D.
As for cameras, I think this thread will be of some benefit:
http://forum.thegamecreators.com/?m=forum_view&t=169206&b=7
It breaks down camera commands rather nice and concisely and the code snippets are very "Human Readable".

Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 26th Oct 2011 01:16
Thanks nonzero. I have had a play with google sketchup in the past, in fact i used it to design the desk im currently working on right now as i wanted a custom one built and couldnt hand draw it to show the people who were making it, so i have had a fair play on it, its a pretty good program but its no blender . That link will be getting a thorough read when i get chance but what i skimmed looks pretty good. Thanks again.

Login to post a reply

Server time is: 2024-11-22 12:35:09
Your offset time is: 2024-11-22 12:35:09