Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Robert Walter  
#1 Posted : Thursday, October 27, 2011 2:51:50 PM(UTC)
Robert Walter

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. :)

Wanna join the discussion?! Login to your forum accountregister a new account. Or Connect via Facebook Twitter Google

Offline Robert Walter  
#2 Posted : Thursday, October 27, 2011 4:06:56 PM(UTC)
Robert Walter

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 Blushing
Offline Benjamin  
#3 Posted : Thursday, October 27, 2011 7:09:55 PM(UTC)
Benjamin

Medals: Admin

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.
Rss Feed  Atom Feed
Users browsing this topic
OceanSpiders 2.0
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.

Powered by YAF.NET | YAF.NET © 2003-2022, Yet Another Forum.NET
This page was generated in 0.371 seconds.