orthographic view

hej, for my game i don’t want to have perspective, so i used this script:

import GameLogic

get the active camera

cam = GameLogic.getCurrentScene().active_camera

set camera to orthographic view

cam.perspective = False

but when i pres “p” in the standard scene (so only a cube) and this script attached to an always sensor in the camera. all i get is a grey screen.
is this a bug or am i doing something wrong?

hmmmmm
you can do it without using python, just select the camera and go to editing (F9) and select orthographic. i have tried it, and too couldn’t see anything. it is possible to set it up without a camera, just delete it and then go into the side or front view as if you were editing. remember that whatever settings that you have, including things like if the view is in wireframe or not, will be carried out into the game, even if you save the game as a standalone application. this can be both an advantage and a cripple at times. but usually an advantage. i don’t know why the camera doesn’t work in orthographic. maybe it depends on how you position it.

note: i have blamed a lot of problems that i have had in blender on a bug. none of them have actually turned out to be because of bugs. :wink:

im not very experienced with game engine, all i can think of is make sure that is the condition is “or” not “and”

“and” would require 2 “always” to be connected to it in order to read true
also make sure that you link them together (really easy to forget)

i hope it is only some thing this easy for you to fix

This method works very well, providing you do not need to switch back and forth between ortho and perspective during the game. I would suggest you use this method.

I don’t know why the script isn’t working, but it may be a bug. I’ve tried to mess with the camera matrix in the past and gotten very unexpected results, so it’s very possible that something is messed up in the code. Either that, or we don’t know what we’re doing :wink:

Edit: I did try the script, btw. Not sure that was clear from my response. When I switched the perspective to false, all I could see anymore was the gray background. The cube I could seen in perspective disappeared.

tnx for the reply longnose,
unfortunatly i need camera view because i want to be able to move and turn the camera.
missleswarm:

“and” would require 2 “always” to be connected to it in order to read true

that is not true, and requires that all connected sensors are true.
and if i had forgotten to connect the logic bricks or used an and statement the wrong way i would just see a cube in perspective view and not a grey screen
tnx for your reply though

o i misunderstood you guys, just select orthographic in edditing screen is indeed a good solution.
tnx for the help