Tagged Questions
0
votes
1answer
28 views
Sharp DX Identity Matrix, Matrix.Forward vector pointing at negative Z
I'm trying to take a steady grip on Sharp DX. Already done some work like translating, scaling and rotating objects. Now i have to calculate the rotation matrix using only direction vector and ...
2
votes
1answer
299 views
How can I create a 2D camera with upscaling and translation?
I've computed a Viewport that is fair in size (a proper aspect ratio to the given device) and then I calculate my ScaleMatrix like so:
scaleMatrix = Matrix.CreateScale(
(float) ...
1
vote
0answers
144 views
Matrix.CreateBillboard centre rotation problem
I'm having an issue with Matrix.CreateBillboard and a textured Quad where the center axis seems to be positioned incorrectly to the quad object which is rotating around a center point:
Using:
...
0
votes
1answer
89 views
How to Draw texture between 2 Vector3
My scenario:
RTS combat style, 1 unit fires beam on another unit
My problem is i want to draw a flat texture between 2 Vector3 points. I have looked at various Billboarding styles but that doesn't ...
2
votes
1answer
204 views
Movement on the X an Z axis are combined?
This is probably a stupid question, but I'm trying to simply move a 3D object up, down, left, and right (Not forward or backward).
The Y axis works fine, but when I increment the object's X position, ...
3
votes
2answers
537 views
How can I implement smooth rotation from one direction to another?
I'm having a problem with animating rotations with 1Matrix.CreateRotationY() with my basic 3D game. Based on where you click the mouse, I want the 3D object to rotate to that direction and then move.
...
0
votes
0answers
168 views
Unity3D - Projection matrix camera frustum
I've used off centre projection to create a custom projection matrix for my camera.
When I run the game I can see the scene correctly in the game view but in the editor view the camera frustum is not ...
2
votes
1answer
90 views
Camera closes in on the fixed point
I've been trying to create a camera that is controlled by the mouse and rotates around a fixed point (read (0, 0, 0)), both vertical and horizontal. This is what I've come up with:
camera.Eye = ...
0
votes
1answer
237 views
3d world vertex translation to go to 2d screen coords
My technical english is a little rusty so to avoid misunderstands please be patient with me :)
I will try to be brief and clear
Situation:
- I have a 2d sprite character on the screen
- I've just ...
2
votes
1answer
423 views
Why use 3d matrix and camera in 2D world for 2d geometric figures?
I'm working in XNA on a 2d isometric world/game and I'm using DrawUserPrimitives to draw some geometric figures...
I saw some tutorials about creating dynamic shadows but I didn't understood why they ...
3
votes
1answer
230 views
Retrieving model position after applying modeltransforms in XNA
For this method that the goingBeyond XNA tutorial provides, it would be really convenient if I could retrieve the new position of the model after I apply all the transforms to the mesh. I have edited ...
0
votes
3answers
360 views
Xna Equivalent of Viewport.Unproject in a draw call as a matrix transformation
I am making a 2D sidescroller and I would like to draw my sprite to world space instead of client space so I do not have to lock it to the center of the screen and when the camera stops the sprite ...
2
votes
2answers
417 views
Passing an objects rotation down through its children
In my topdown 2d game you have a player with a sword, like an old Zelda game.
The sword is a seperate entity, and its collision box "rotates" around the player like an orbit, but always follows the ...
8
votes
1answer
1k views
Screen space to world space
I am writing a 2D game where my game world has x axis running left to right, y axis running top to bottom, and z axis out of the screen:
Whilst my game world is top-down, the game is rendered on a ...
1
vote
2answers
603 views
Transformation order when dealing with Meshes
I have created a player model out of primitive types. To do this I have created a Model class and Component (mesh) class. Each model consists of one or more components my problems start when you have ...
1
vote
1answer
287 views
How to prevent 2D camera rotation if it would violate the bounds of the camera?
I'm working on a Camera class and I have a rectangle field named Bounds that determines the bounds of the camera. I have it working for zooming and moving the camera so that the camera cannot exit its ...
2
votes
1answer
315 views
Confused about order of operation when using a Matrix in XNA, C#
Here are two different pieces of code
This is what I started with
Vector2 hold = Vector2.Transform(pos1, mat1);
Matrix inv = Matrix.Invert(mat2);
Vector2 pos2 = Vector2.Transform(hold, inv);
And ...
4
votes
1answer
274 views
Getting the Bounds of a 2D Cameras View with Zoom
I am using a 2D camera, which does rotations and zoom. Currently, I am using the following to get my MinX, MinY, MaxX and MaxY...
public float MinX
{
get
{
return ...
5
votes
3answers
1k views
XNA 4.0: 2D Camera Y and X are going in wrong direction
I asked this question on stackoverflow but assumed this might be a better area to ask it as well for a more informed answer.
My problem is that I am trying to create a camera class and have it so ...
1
vote
1answer
637 views
XNA 2D Transform Matrix Scale at Zoom Question
This is the complete code I am currently using for my camera. It is incomplete and only partially understood by me (I am working off an example), but I have managed to hack some functionality with ...