PDA

View Full Version : Multiple cameras


arty-fishL
01-11-2012, 02:40 PM
I decided to look back upon something I experimented with a while back when I had less knowledge of the guts of Alice, and I got it working :).

This world demonstrates a simple concept, the ability to use multiple cameras in an Alice world.
What is the point in this :confused:, you may ask; well, in the camera's current state there is no point as you have the ability to position the camera and modify it as you like, meaning another camera is just a waste of space.
However, Alice actually has built in support for more types of camera.

The default camera you get is a symmetric perspective camera.
There is also an orthographic camera and a perspective camera.
A projection camera exists too, but it wont work for me.

By default the other cameras have weird values that make them look strange, but they can be changed in their seldom used properties.

Anyway, enough of that, to the actual world.
Controls
1, 2, 3 - switch cameras
arrow keys - move cameras
z/x - tilt cameras forward/back
spacebar - reset camera positions

Experiment with it.

room14
01-11-2012, 04:35 PM
I decided to look back upon something I experimented with a while back when I had less knowledge of the guts of Alice, and I got it working :).

This world demonstrates a simple concept, the ability to use multiple cameras in an Alice world.
What is the point in this :confused:, you may ask; well, in the camera's current state there is no point as you have the ability to position the camera and modify it as you like, meaning another camera is just a waste of space.
However, Alice actually has built in support for more types of camera.

The default camera you get is a symmetric perspective camera.
There is also an orthographic camera and a perspective camera.
A projection camera exists too, but it wont work for me.

By default the other cameras have weird values that make them look strange, but they can be changed in their seldom used properties.

Anyway, enough of that, to the actual world.
Controls
1, 2, 3 - switch cameras
arrow keys - move cameras
z/x - tilt cameras forward/back
spacebar - reset camera positions

Experiment with it.
heh. you weren't lying about the camera looking strange. anyway. does that mean we can make cameras that look like watching with one eye?

arty-fishL
01-11-2012, 04:43 PM
heh. you weren't lying about the camera looking strange. anyway. does that mean we can make cameras that look like watching with one eye?
I think so, mess about with the seldom used properties of the cameras and you can make them look better; try setting the min values to negative numbers and the max values to positive ones.

Mr Kidnapper
01-11-2012, 09:39 PM
Hmm. No wonder they didn't offer these cameras. Broke. I don't even know what's wrong with them and I have no idea what these minimum and maximum XYs are.
The problems are the camera methods at edu.cmu.cs.stage3.alice.core.decorator and edu.cmu.cs.stage3.alice.core.camera
Decorator's camera methods are essentially copypasta of each other.
Don't seem to know what's wrong with them either. Not much documentation on cameras.
Edit:
All right. The makers of this camera are a bit silly. They made a camera extremely true to the definition of orthographic projection, which means the objects in its view will not change size no matter how far or close you moved the camera (Infinitely far.) I seem to recall that this is completely useless. I have no idea why they would add it like that.
Instead, let's make the new definition for an "Orthographic Camera" the same as 3ds Max's... and just about every other 3D rendering engine out there. It's really an Isometric Camera. If you google'd the term you'd see something really archaic, but it's more useful than you think.
An Isometric Camera works much like an orthographic projection, except that it is capable of detecting depth. You're effectively in a perspective mode, except without all of the perspective distortion.
The deal with the nonfunctional Perspective Camera is that a true perspective projection is not made to work in most 3D rendering situations. They are intended to view objects at a distance close to the camera, and all others at a far distance will warp. This was solved in the creation of Parallel projection, which is made to view objects at infinite distance without warping.

So the moral of the story is: When people say perspective, they actually mean Parallel Perspective. When they say Orthographic, they really mean Isometric. Don't correct them on it, they're still technically correct. All professional rendering solutions AFAIK only involve these two cameras, so we should simply out with the perspective camera and fix the Orthographic Camera.
The "Projection Camera" has, in fact, nothing to do with anything (All cameras are projections)—It's not even a real camera.

jediaction
01-11-2012, 10:01 PM
Jeesh. I've been trying forever to get more than one camera to work, and you just come in blasting with the discovery....all I can say is....Well done! It's about time someone figured it out. I wanted to have a system like this for gun sights....I should do it for Hero's 2. Hey, can you explain to me how you did this?

Mr Kidnapper
01-11-2012, 10:35 PM
Ha. Late edit, but you should read my previous post. Perhaps you have been brainwashed by my constant utterance of a need of a Orthographic Camera, but sir, these are not the cameras you are looking for. Move along.
In fact, the cameras aren't broken. They work perfectly. It's just that the seldomly used values are a spazz and no one knows what they do.
Until someone figures out how to program an Orthographic (Isometric) Camera, we're not going to have closed sights for a while.

You know what these cameras are good for? If you make multiple Parallel Perspective Cameras, you can probably program Alice to run two separate cameras in the same window, or two different windows at the same time. There'll be two rendertargets though.

jediaction
01-12-2012, 09:22 AM
Actually I was talking about one camera that has a different field of view like the third camera.

mdemonion
01-21-2012, 07:47 AM
Wow..That's really nice that there is also an orthographic camera and a perspective camera...One can swap camera according to their need..

room14
01-22-2012, 02:48 AM
Wow..That's really nice that there is also an orthographic camera and a perspective camera...One can swap camera according to their need..

except they are basically unusable.

mdemonion
01-28-2012, 06:37 AM
except they are basically unusable.

May be you are right but it has somewhat new features of more than 1 camera and I like this..