Why doesn't BGE show same thing as Camera does?

Hello, I’m a RANK nube, starting to use Blender 2.49b on Windows Vista, and I’ve been having a problem with the game engine whereby I don’t seem to be able to get the game engine to show what the Camera is pointed at and sees; here’s the simplest occurance:

  1. start with the default view, get rid of the cube, bring in the monkey(so I can better understand what camera/subject orientation I’m seeing);
  2. split the screen;
  3. view one part of screen from camera, other still from top;
  4. link the camera to the monkey (select camera, shift-rmb on monkey, ctrl-t) so I can move the camera and keep it pointed at monkey;
  5. select the camera;
  6. put cursor in camera view port;
  7. engage GE; result: see monkey in GE, although with DIFFERENT LIGHTING(what’s up with that?);
  8. MOVE camera far over to left, engage GE: SEE NO MONKEY IN GE;
  9. experiment with moving camera less to the left, engage GE: MONKEY SHOWS, BUT NOWHERE NEAR CENTER, THOUGH STILL SHOWING FINE CENTERED IN CAMERA VIEW.

Am I seriously misunderstanding something (pretty likely, but I don’t see what yet), or is this some kind of bug?

Add shading, and change to textured mode. Also if you don’t have a light it’s going to be pitch black.

I think ctrl t adds a trackto constraint, right? Constraints don’t work in the game engine. What you need to do is select the camera, add an always sensor, an and controller, and a edit object actuator. Chane the edit object from add object to track to, then set it for the correct object to track. That should do it.

Parenting the camera works in BGE, but yeah ctrl t is constraint.

@olderLearner - If you’re a new Blender user, you should use 2.5. There’s no reason to use an outdated version if you’re just starting to learn to use Blender.

Aha, ok, I didn’t realize constraints didn’t work in GE, I was going by an example I saw for how to make the camera POINT at an object.
I’ll try your suggestions, thanks!

I’ll try those; and I should have emphasized that my example used the default scene: cube, camera, light.

Also if you’re light is far away it’s not going to help, bring it close, or increase the energy.

@Solarlune, Many people are posting lots of bugs with 2.5X, 2.49B is still the most stable version. 2.5 will be better once some of the annoying bugs are fixed, but for now I still say 2.49B is best for at least another 4 or 5 months.

Ok, I’ll give it a try; I was reluctant to try a beta, 'till I just saw 2.57a is “stable”.

I heard of one bug in 2.57a, but I mean it’ll get fixed. I have both 2.49 and 2.57 and the 2.57 is so impossible to get used to. Everything is tiny, there is bars and buttons with no names, you have to hover over them to figure out what they are, and everything is completely moved.

I dunno I just don’t like the interface.

hmm, ok, I don’t get it, that doesn’t let me do what I would think I should be able to, namely set a scene in blender, check the view of that scene through the camera, and then see that same view of the scene in GE, as I move the camera to choose what to see.

When I do what you suggested, if I then move the camera to the left in the top-view portal (in the monkey altered default view I described above), then I see the view in the camera-view portal show the monkey move to the right as I move the camera to the left, rather than remain centered in the view with the orientation of the monkey changing as I move the camera. (and yes, I eventually remembered to link the logic blocks!)

And then when I open GE, when cursor in camera-portal, I see nothing, and when in top view-portal, I see the monkey but with altered lighting from what I see from camera. (I guess I’m sorta wrong about seeing nothing in camera portal after move camera; if I move camera and still see monkey in view, then I see it in GE, but of course if I move camera so I DON’T see monkey in view, then I don’t see it in GE also, as would be reasonable. So what I WANT to do is make the camera ALWAYS POINT at the monkey, as I move the camera to “set” the scene I want to be available to the user in GE).

Maybe I should explain what I’m trying to work toward, as it doesn’t actually involve a lot of camera movement, I’m just trying to make sure that what I’m setting up in a scene is in fact what I get when I use game engine, and I assume I have to move the camera in order to create the eventual desired view of that scene.

I want to make an interactive view of a complex object, so that the user can rotate the object and see different aspects of the object; but the problem I run into is that I’m importing the “object” as a set of .stl objects, and I’m having trouble making the GE view show what I’m seeing through the camera, under the assumption that looking through the camera would be the correct way to “set” the scene to be viewed in the GE. So I was just using the altered default scene as a simple example of the problem.

So you can’t see things through the camera, huh? Pressing 0 on the numpad should switch to the camera. Does that work? Perhaps posting a screenshot would work.

@fayt - 2.5 may have some issues, but it’s pretty much stable. The 2.6 release is supposed to come around soon (in June, I think), as well. I’m just saying that it’s counter-intuitive for a new user to learn how to use 2.4, and then learn how to use 2.5 in a couple of months - it’s better just to pick up the newest version and learn it.

No, it’s not that I can’t see things through the Camera, it’s that when I position and orient the camera to show the view I want the Game Engine to start at, the Game Engine does NOT present what the Camera view was showing before I entered Game Engine. Sometimes the Game Engine shows NOTHING at all, and other times it will show the object but with different lighting than what the Camera view was showing.

In other words, I can generally see things through the camera, but I want to LINK the camera to an object so I can positon the camera where I want it and have it constantly POINT at the specified object WHILE I’m positioning the camera, so that then the GAME ENGINE will/should open WITH the view I can see through the camera.

But that’s not happening. (Maybe this is a bad way to “set a scene” for the game engine?)

To illustrate the problem, I use the DEFAULT SCENE that we get when entering Blender, with the monkey replacing the Cube and same position and orientation of camera and lighting.

In my FIRST attempt, I link the camera to the object within Blender via a “auto track” constraint (ctrl-t). That works IN Blender, as far as showing me what the camera would see of the object as I move the camera, since the camera stays pointed at the object. If I hit “P” for Game Engine immediately after linking camera and monkey without moving the camera from its original default position, the result IS a view of the monkey, although the LIGHTING is now different, which is a problem.

But when I MOVE the camera in Blender from the original default position, over to the far left side of the screen, and then hit “P”, I now do NOT see the monkey at all, even though I DID see it through the Camera view BEFORE I hit “P”. (My original post details the steps I followed in this regard.)

In my SECOND attempt, I followed Mcguinessdr’s suggestion above relating to “track to” in the logic blocks, but that didn’t let me keep the camera pointed at the monkey while WITHIN Blender, I suspect that’s for making the camera stay pointed at an object while in the GAME ENGINE.

What I’m trying to do is to SET THE SCENE FOR THE GAME ENGINE, by using what I can see through the camera while moving it BEFORE I enter the game engine.

Is that somehow a wrong approach?

Use both constraint types. The track to constraint in blender and the track to constraint method for the game engine. The game engine camera view should then match the camera view in the viewport.

Ok, tried that, but they don’t match. If I can do it, here’s screenshots, first has camera linked to monkey in Blender, with logic link of camera to monkey in Game Engine, and (not showing), cursor in camera view port before enter BGE; second is after hit “P”. Note that the monkey was centered in the camera viewport, but in BGE it floats near the bottom of the view, and has different lighting effects on the facets of the monkey.



And here’s zoomed in on camera view to show what the original lighting was, in comparison to the BGE lighting effect above:


Also I should add that if I were to engage BGE with the camera zoomed as above, I’d see nothing, no monkey anywhere.

Here’s a demo to show the BGE showing the same view as the camera view in the 3d viewport http://screencast.com/t/M1CYdeQ4gz3

Attachments

track.blend (251 KB)

Ok, thanks, I looked at your demo, and I can see that you had the monkey in the camera viewport, and BGE shows exactly the same, and then you moved the camera, I think, and zoomed, and BGE again shows the same as the result in the camera viewport, and then you rotated the monkey, and BGE again shows the same result as the camera viewport; but I don’t see how you made that happen. I thought I did what you said, but I don’t get the same results, so maybe I’m still doing something wrong.

Oh, and when I tried to load your .blend file, I got an error, “file incomplete”.

In the Actuator you don’t have the 3D button selected.
If you use GLSL Materials (from the Game menu at the top of the blender window) and use buffer shadows for your lamps, the 3dview and game engine view should look the same

OK, that’s starting to work, thanks!! Hopefully my last question about this: how do I set “buffer shadows” for the lamp?
I now set GLSL Materials checked, and selected 3D button, which does now yield matching camera view and BGE, but not smoothed monkey yet.