Nuevo blog !!!!
Thursday, May 22, 2008 7:37:02 PM
http://aarcoraci.homeip.net/blog/
Muchas gracias por el aguante !
desarrollo y tutoriales
Thursday, May 22, 2008 7:37:02 PM
Wednesday, June 13, 2007 3:00:57 PM
Saturday, April 28, 2007 7:47:41 PM
Projection - The projection matrix is what transforms 3D coordinates into screen coordinates. It controls whether we do a perspective projection (things become smaller the farther away they are), an orthogonal projection (keeping objects at their original size as often seen in CAD and modelling tools) or some crazy other kind of projection.
View - The view matrix defines the position and orientation of the viewer (commonly referred to as the camera).
World - Before you draw a mesh in your scene, you will change the world matrix to control where the mesh is drawn. All meshes are (usually) modelled with coordinates around the coordinate system's center, so if you want to draw a tree and some specific position, you first set the world matrix to that position and then call the tree's drawing method.
Thursday, April 26, 2007 10:50:36 PM
Tuesday, April 24, 2007 9:11:49 PM
Thursday, March 29, 2007 10:52:25 PM
Friday, March 23, 2007 10:38:35 PM
#region using
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
#endregion
namespace FantasyCamera
{
public class camera
{
#region vars
//matrices
private Matrix view;
public Matrix View
{
get { return view; }
}
private Matrix projection;
public Matrix Projection
{
get { return projection; }
}
private Matrix world;
public Matrix World
{
get { return world; }
}
//end matrices
private Vector3 position;
private float ratio;
public float Ratio
{
set { ratio = value; }
}
private float nearClip = 1.0f;
private float farClip = 1000.0f;
private float fov = MathHelper.PiOver4;
private float yaw;
private float pitch;
private float rotationSpeed = 1f / 160f;
private float forwardSpeed = 50f / 60f;
#endregion vars
public camera(int w, int h)
{
ratio = w/h;
}
public void update()
{
KeyboardState state = Keyboard.GetState();
Vector3 movement = Vector3.Zero;
//movement
if (state.IsKeyDown(Keys.Up))
{
movement.Z -= forwardSpeed;
}
if (state.IsKeyDown(Keys.Down))
{
movement.Z += forwardSpeed;
}
if (state.IsKeyDown(Keys.W))
{
movement.Y += forwardSpeed;
}
if (state.IsKeyDown(Keys.S))
{
movement.Y -= forwardSpeed;
}
//lock sides
if (state.IsKeyDown(Keys.Left))
{
yaw += rotationSpeed;
}
if (state.IsKeyDown(Keys.Right))
{
yaw -= rotationSpeed;
}
//look up and down
if (state.IsKeyDown(Keys.Q))
{
pitch -= rotationSpeed;
}
if (state.IsKeyDown(Keys.E))
{
pitch += rotationSpeed;
}
Matrix rotationMatrix = Matrix.CreateRotationY(yaw);
Vector3.Transform(ref movement, ref rotationMatrix, out movement);
position += movement;
// matrices
view = Matrix.CreateLookAt(position, position + rotationMatrix.Forward + new Vector3(0,pitch,0), Vector3.Up);
projection = Matrix.CreatePerspectiveFieldOfView(fov, ratio, nearClip, farClip);
world = Matrix.Identity;
}
}
}
//matrices
private Matrix view;
public Matrix View
{
get { return view; }
}
private float rotationSpeed = 1f / 160f;
private float forwardSpeed = 50f / 60f;
public camera(int w, int h)
{
ratio = w/h;
}
view = Matrix.CreateLookAt(position, position + rotationMatrix.Forward + new Vector3(0,pitch,0), Vector3.Up);
Matrix rotationMatrix = Matrix.CreateRotationY(yaw) * Matrix.CreateRotationX(pitch);
Vector3.Transform(ref movement, ref rotationMatrix, out movement);
position += movement;
// matrices
view = Matrix.CreateLookAt(position, position + rotationMatrix.Forward, Vector3.Up);
projection = Matrix.CreatePerspectiveFieldOfView(fov, ratio, nearClip, farClip);
world = Matrix.Identity; NOTA Recuerden que cuando necesiten las matrices world view y projection, se las tienen que "pedir" a camera.
Ejemplo si quieren dibujar un objeto:
objeto.draw( instanciaCamara.World, instanciaCamara.View, instanciaCamara.Projection )
Friday, March 23, 2007 12:30:41 AM
Thursday, March 22, 2007 12:09:58 AM
Queres un foro en español de XNA ?
Total: 4 votes
software necesario
preparacion del proyecto y ventana inicial
metodos importantes - lectura del teclado
Tutorial 3 - importar un modelo
tutorial 4 - modelos con textura y rotacion
tutorial 4 - modelos complejos
tutorial 6 - bases de animacion esqueletal
Tutorial 7 - como crear una camara y controlarla
FORO motorXna
shawnhar blog
Excelente lectura sobre el content pipeline
xna para torpes
Articulo - mundo 3d y transformaciones