Delta Engine
»
Support
»
Rendering
»
Cameramovmenet over a Scene
Joined: 8/24/2011(UTC) Posts: 68
Thanks: 4 times
|
For my application I want to have a view on a desk. The desk is seperated into different areas. The camera is only showing one area at once and when pushing the cursor left/right it should move to a predefined area. I'm using a simple Material2D with a desk texture for the desk. As it is bigger than the screen, I have positioned it like that Code:desk.Draw(new Rectangle(-1.0f, 0.0f, 4.0f, 1.0f));
This would make 5 areas of 1.0f, 1.0f. For the camera I have taken the FreeCamera, and initialize it like this: Code:camera = new FreeCamera(new Vector(0.0f, 0.0f, 10.0f));
camera.Activate();
camera.IsLocked = true;
camera.Pitch = 270f; //camera looks down
The keyevents for left and right Cursor are triggering a camera movement, which will move the camera over the course of a given number of frames to another area. In the gameloop I call the materials as follows: Code:
background.Draw()
desk.Draw()
camera.Update() // here are the keyboard events
Now when I press the cursors I don't see any movement :( But when I'm using a Grid.Draw() in between background.Draw() and camera.Update() I will see the movement of the camera, as the Grid is moving aside. There must be something I'm not considering, right? Any help would be appriciated. :)
|
|
|
|
Joined: 8/24/2011(UTC) Posts: 68
Thanks: 4 times
|
Just stumbled over this topic. That seems to be exactly what I want,.. I hope. Sorry for the double post then
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
We will provide more sample games and tutorials about such topics in the near future to make it more clear what to do for custom 2D/3D rendering. There are plenty of unit tests around, but they are just unit tests and might not cover what people are searching for.
I also just improved the comment of the draw method to make sure that it is rendered in 2D and unaffected when anything in 3D changes like the camera. A link to the Billboard class is also provided.
|
|
|
|
Delta Engine
»
Support
»
Rendering
»
Cameramovmenet over a Scene
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.