Perspective drawing...

Blitz3D Forums/Blitz3D Beginners Area/Perspective drawing...

tyoud(Posted 2011) [#1]
Quick question,

If I have several 3d models in a scene, and I wanted to write a program to look at them all from the top down - imagine the castle demo with a minimap - but one that is procedural - not cutting and pasting from pregenerated textures.

I have the camera done, that part is easy. But I want to be able to turn off the perspective in it.

The visual effect is as if the camera was very very far from the objects below, but we were visually "zoomed" in on it. So that if I look slightly to the side of the object, it doesn't foreshorten...

Does that question make sense? Is it a simple, easy to set camera option to turn off "3d" foreshortening?

Maybe that code example of lens distortion could be used to create a more "straight on" effect?

Last edited 2011


tyoud(Posted 2011) [#2]
Oops, I think I found my answer -

CameraProjMode camera,mode

choose mode "2"


Yasha(Posted 2011) [#3]
CameraProjMode myCamera, 2


Use a value of 1 to re-enable perspective, and 0 to disable the camera entirely.

Note that without perspective, objects will appear sized in proportion to the camera's scale - for most purposes, this means they'll be far too large. You need to zoom out by a fairly large amount for things to be small enough to fit on screen if they fit comfortably with perspective enabled. By default the camera's ortho view is two units wide, so you'll be wanting to set CameraZoom to something on the order of 2.0 / GraphicsWidth().

EDIT: Damn, you ninja'd me even though I checked right before posting... that was close!

Last edited 2011


tyoud(Posted 2011) [#4]
I didn't think of the zoom though, I can't wait to see how this works! :)

Edit - works great -
and the zoom number for CameraZoom works in an interesting way -
If it's set to 1 or .5 it's like being right above the mario character in the castle demo

If it's set to 0.05 or so it's like you're higher up.

Last edited 2011