Hot answers tagged camera
8
The typical way of handling this is to create a camera object. The simplest form of a camera is just a position. This simple camera defines the "center" of the current view. So you don't modify all the positions of your tiles/entities, you just subtract the camera coordinates from the positions when drawing. In this situation, the camera does not "move".
...
5
Most any top down perspective will work. 2D games have done this in the past with games like PacMan:
Additionally, any top down perspective where the camera is at the center of the screen. This gives the kind of view you showed in your comment:
Both of these assume the players are sharing a play field. If the players are not sharing a play field, you ...
5
The industry standard for first-person view simulation in most shooters is to have character models and animations distinct from those used for third-person view. There are several reasons for this:
The player has a much smaller field of view upon the world than a real person in the character's situation would, and he lacks other forms of input such as ...
3
What values should be used for the near and far planes depends entirely on your scene. It doesn't matter what units you're using, as long as the near and far planes are specified in the same units as everything else.
Set the field of view to whatever you think looks good.
Set the near plane as far as you can get away with - as far as you can make it ...
3
You'll have to set the score position relative to the view position every update event.
Some basic pseudo code from what I remember of GML.
score.x = view[0].x + 15;
score.y = view[0].y + 15;
You can do something similar with the drag and drop interface, but I haven't touched GameMaker for years so I can't help you with that.
2
No this is the wrong way to go about this.
How are you going to do trap detection? What about when the player reaches the edges of the walls? Will your viewing system work for dungeons or will you have to re-write a significant portion of the code?
The world is geometry. The player is geometry. The world doesn't move. The player does. Set the ...
2
This is a more general solution
To start you will need some data.
The Camera's position represented by P (this is a point)
The normalized viewing vector represented by v
The Camera's up vector represented by up
The Camera's right vector represented by w (this is the cross product of v X up)
The near distance represented by ...
1
It is common to render the players own character vastly different from other characters in order to avoid these issues.
With a real rifle you have got two mechanics that don't translate well to computer games:
When not aiming you'll typically raise your head higher to get a better view, some games implement multiple different tiers of aiming to simulate ...
1
In my first attempt, I created a new projection matrix for the smaller window, and then tried to rotate the frustum using LookAt, this almost worked but had some distortion when tilting up or down.
However, using a different approach it turns out the problem was quite easy to solve in DirectX. The BoundingFrustum class that I used (while It can be ...
1
I'm not familiar with DirectX, but the BoundingFrustum docs you link to say that it can be constructed from a projection matrix.
All you need to do, then, is multiply your actual projection matrix by a matrix which (if you used it to draw with) would scale/translate the graphics so that the rectangle you want fills the viewport, then use that matrix product ...
1
Another option is to create an actual 3D object that represents the keyhole or tube, and position it appropriately.
That has the advantage that it gives you more freedom to play with the camera position. You can either scale the model or move the camera to get different sized holes. It should also make it fairly easy to transition smoothly from another ...
1
You could either use a post processing effect to draw a 2D overlay to the screen, or modify the stencil buffer to achieve the results you want. Ogre may facilitate the overlay effect easier than it would modifying the stencil buffer.
http://en.wikipedia.org/wiki/Stencil_buffer
1
The most expeditious way to extract height information might be to draw it:
Set draw parameters to an orthographic projection directly down toward the terrain.
Draw to a render target with a depth-map shader.
Store render target contents to a 2D array, sample it for heights, and save it for as long as it is useful (no need to reproduce every frame).
I ...
1
What you need to do is unproject a 2D screen coordinate to a ray within the world. Perform intersection tests of some sort with the ray, and then perform whatever handling logic you want. The first link explains the process of creating a ray from a screen coordinate, it uses DirectX, but the principle is the same. How you choose to identify the object you ...
1
It's probably the near clip distance of the camera. So your camera is outside of the box but the near clipping plane sees through it.
Usually you fix this by making sure the collision on whatever is moving with the camera is larger than the near clipping plane so that you can't physically get close enough to the world to see through it.
1
Usually assign a child to camera is a bad idea. It will work, of course, but can give a little headache in your hierarchy. Try to create a new empty gameobject and assign camera and the weapon to it (even if i dont like that main camera is a child).
For your problem, i simply cant get it and your images are not clear (i didn't see anything wrong, remember ...
1
A lot of good answers here. I'll try to not repeat any of them. Sometimes it's easier to think of in terms of a camera, like how Direct3D does it (note: haven't played with a lot of post 9.0c)
"Moving the world" like in the Futurama sense that someone out there quoted is a very good way to look at it ("The engines don't move the ship at all. The ship stays ...
Only top voted, non community-wiki answers of a minimum length are eligible

