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.

2D All the way! / when placing 3d objects on a 2d map, how do I make 0,0 the top left corner instead of center?

Author
Message
Wolf Dreamer
20
Years of Service
User Offline
Joined: 13th Sep 2005
Location: the land of chaotic dreams
Posted: 23rd Feb 2006 20:10
When placing 3D objects around on a 2d screen, why does it seem to default the location 0,0,0 as the center of the screen?

I've looked through examples and the help file, but can't find this.

When I position object 1,0,0,0 I want it at the top right of the screen, not the center.

the last sane human being in a world gone mad
Scraggle
Moderator
22
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 23rd Feb 2006 23:11
The position of the object is not relative to the screen EVER, it is positioned in a '3D Universe'. The camera will always look directly at newly created/loaded objects making them appear in the centre of the screen. You can avoid that be turing off the AutoCamera.

If you want to make the object appear in the top left corner of the screen then either move the object or move the camera.


Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 24th Feb 2006 00:19
Yes. There are

Screen width() / 2,

screen Height() / 2

commands which could be used to reposition the Origin.

Scraggle
Moderator
22
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 24th Feb 2006 00:40
Pincho, think about what he asked then think again about the answer you gave.


Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 24th Feb 2006 01:21 Edited at: 24th Feb 2006 01:25
It works if you do this.

Edit: Edited from one of my games, so contains some irrelivent rems.


Wolf Dreamer
20
Years of Service
User Offline
Joined: 13th Sep 2005
Location: the land of chaotic dreams
Posted: 24th Feb 2006 04:08
That doesn't seem to work, or do anything at all.

And I check the help file, there is no autocamera. I check for just the word camera and see a lot of stuff though.

Perhaps I create one object which the camera will focus on in the center of the screen, and then have everything else be placed at -screenwidth()/2 and -screenheight()/2.

If there is ... wait, wait, wait. Just thought of something when typing this. Just went and checked for autocam, and sure enough, there it is.

Now, after adding AUTOCAM OFF, nothing loads up at all. That is strange.

I'll keep trying various things and see if I can get anything to work.

the last sane human being in a world gone mad
mr joe
21
Years of Service
User Offline
Joined: 12th Aug 2004
Location: Edinburger, Scotland. DBC
Posted: 24th Feb 2006 07:24
Try setting the camera zoomed out. Probably your objects have just loaded off screen.

DB is very odd I found when trying to display 3d objects on the same scale as 2d images. One 640x480 plain will display fine if you position it at 0,0,400. But in another game with lots of 8x8 tiles, the only values I found that worked were -317,-235,400. In both cases I found autocam off made no difference, but I'm only using plains, I don't know if that would affect it.

My only advice would be to write a piece of code to let you alter the offset values in-game and mess around till you find a set that work. You'll probably have 0,0 at the bottom right but you might be able to fiddle with zrotate camera or something.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 24th Feb 2006 11:14
Quote: "That doesn't seem to work, or do anything at all."


Well it is for DB Classic. You need to change it for DB Pro. Must be quite easy, but I don't have DB Pro.

Login to post a reply

Server time is: 2026-07-02 01:26:49
Your offset time is: 2026-07-02 01:26:49