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 Professional Discussion / 2D Isometric view with a 3D camera/scene

Author
Message
tiresius
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 15th Nov 2009 18:49 Edited at: 16th Nov 2009 07:25
Hey folks-

I've searched the forums with not much luck but I'm not even sure what the terminology is for this. Basically what I want is to have a 3D level, but the view would be a fixed isometric view and instead of the usual "fish eye" view of the 3D camera I'd like the screen to look like genuine old-school 2D.

I've heard of pulling the camera way back and zooming it in or using some sort of FOV setting to create this effect but I'm at a loss to the actual steps. Does anybody have any code snippets or source demos of this effect? Thanks for any help!

I'm not a real programmer but I play one with DBPro!
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 15th Nov 2009 19:38
Here's a little demo, really it involves setting the FOV really low, like 0.2, then moving the camera back a lot, like 50,000 units, and setting the camera draw range to suit.

Use the mouse wheel to zoom, and the left and right cursor keys to rotate the camera.




Health, Ammo, and bacon and eggs!
Math89
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 15th Nov 2009 21:51
You can use this function (which requires IanM's plugin):
Profit
19
Years of Service
User Offline
Joined: 19th Feb 2006
Location: United States
Posted: 15th Nov 2009 22:05
cloggy's d3d plugin also has a function to do this.


tiresius
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 16th Nov 2009 07:30 Edited at: 16th Nov 2009 07:32
Thanks guys, I went with the screen fov method and it seems to work well. Had to jack the camera way way out though because my level is scaled quite a bit. Other than some small z-fighting it looks really great.

Here is a comparison screenshot... this was for the 3d marble platformer I've been working on for the last few years. I decided a "classic" view would be a cool thing to have for certain levels.

Standard 3D Isometric


And here is the 2D fixed isometric (classic):


I'm not a real programmer but I play one with DBPro!
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Nov 2009 08:23
There's no difference, other than the Y position of the camera in the second picture is lower than in the first one and is further away.

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)
Virtual Nomad
Moderator
19
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 16th Nov 2009 08:32
Quote: "There's no difference"

huh? even tho every grid-space at the same angle in the 2nd pic is exactly the same size?

i like the 2d since everything is clearer and more visible (and because it reminds me of the old-school marble games ).


Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Nov 2009 09:02
Yeah, I just noticed the difference.

Cloggy's or IanM's plugin will help you then.

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Nov 2009 09:52
So why not post some code to proove that?, I'd like to see how Cloggy's and IanM's techniques cope with Y rotation.


Health, Ammo, and bacon and eggs!
Math89
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 16th Nov 2009 12:11
Here is a real iso camera:
tiresius
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 16th Nov 2009 16:05
Just in case there's confusion - I wasn't posting pictures as a problem, I am happy with the results. Although there is minor z-fighting where edges compete and there is some bleed through (it can be seen in VanB's demo of the stacked blocks as well) so I will be looking into some alternatives (like IanM's plugin) to see if that is corrected. Maybe it's just a problem with the projection itself? But I still think it looks cool and makes it behave like a completely different game.

I'm not a real programmer but I play one with DBPro!
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Nov 2009 17:54
Quote: "Maybe it's just a problem with the projection itself?"


No. Only with the particular method you are using. "Z-fighting" usually occurs when the hardware is struggling to decide which polys are in front of other polys. This can happen either because the polys are in fact close together or because numerical precision issues make it hard to decide which is which. In your case moving the camera back a long way probably means that your camera near and far values are also large. If you are using floating point arithmetic then the arithmetic processor may find it hard to accurately compare things like "50000 - 100.1" and "50000 - 100.2". The inaccuracy arises because the floating point accuracy is governed by the numerically larger of the two numbers in each difference - and floats only have 6 or 7 digit accuracy.

Login to post a reply

Server time is: 2025-08-08 15:55:43
Your offset time is: 2025-08-08 15:55:43