Tag Info

Hot answers tagged

33

I think the direction of the coordinate axes are holdovers from different domains where the crucial plane was different, and X/Y were aligned with that crucial plane. In some applications the ground plane was the most important, thus X/Y were the ground and Z ended up perpendicular to that. For games however the crucial plane is usually the screen ...


4

How do you want this to behave? There are different ways to do this. A simple option is to just move the object by some fixed number of world space units for each screen space unit (pixel, say) that the mouse moves. Another option is to take the vector of mouse movement and project it onto the axis of movement through the normal projection/camera ...


4

I would expect your matrix multiplication code to look like | 1 0 0 | [x,y,1] * | 0 1 0 | = [x+50,y,1] | 50 0 1 | This is because matrix multiplication is defined so that you go by row in the first operand and by column in the second operand. Here's the relevant formula from wikipedia, although you should consider reviewing the ...


3

Your formula is correct. I would suggest normalising the quaternion at the end, though, or any stage involving interpolation will likely be messed up. What I believe is happening is that your up vector is (0, something, 0) and your normal vector is (0, -1, 0). In this very specific corner case (when the input vectors are opposite to each other) there is no ...


2

It's mostly legacy from the times when all that could've been made with 3D was some screen-space rotating cube or parallax scrolling or something similar. In such applications, Z was "depth" because X and Y were the axes for the screen plane. As demos were getting more advanced, the original conventions stayed because it's easier not to change anything that ...


2

To illustrate, look at this image generated by Wolfram Alpha: You have your 3 local coordinate axes and you want to coincide any of them with a given forth vector (for instance (1/2, 1/2, 1/2) as in the image). To do that, you need to rotate your object. A rotation is best described as a combination of an angle and axis to rotate around. So how do we find ...


1

I figured out the best way to do this is to check the screen size on the device and base a boolean conditional to device on which axis to use. This is tested and working great. // Check the screen layout to determine if the device is a tablet. public boolean isTablet(Context context) { boolean xlarge = ...


1

As far as I have ever gleaned the Y = up/down, and Z = depth is based off of physics where gravity is always in the (-Y) direction, and then adding 3D means you don't want to change a fundamental, so it was made depth. On the Z = up/down method though that is a throw back to mathematicians. because X/Y was drawn on the paper that was flat on the table when ...


1

Because the coordinate system that are used in games are based off of the dimension of the monitor. When computer renders anything, it starts at the upper left hand corner which gives the x, and y coordinate of [ 0, 0 ]. As the rendering progresses towards the right side of the screen, the x value increments, respectively when the render moves down, the y ...



Only top voted, non community-wiki answers of a minimum length are eligible