Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualFantasyVII

Posted 15 October 2012 - 04:46 PM

Hello everyone,

So I have this cube that I made in Sketchup and I applied a 4096 X 4096 texture on it. Here how it looks in Sketchup:-
Posted Image


and here is how the original texture looks:-
Posted Image


and here how it looks in my game:-
Posted Image


I just want to know why does it look so so bad?

here is the Cube Class when it load and draw the cube.

namespace _3D_Tower_Defense
{
	class CubeModel
	{
		Model Model;
		public Vector3 Position, Rotation;
		Matrix ViewMatrix, ProjectionMatrix;
		Matrix[] Transforms;
		public CubeModel()
		{
			Rotation = Vector3.Zero;
		}
		public void Initialize(GraphicsDeviceManager graphics, Matrix ViewMatrix, Matrix ProjectionMatrix)
		{
			this.ViewMatrix = ViewMatrix;
			this.ProjectionMatrix = ProjectionMatrix;
		}
		public void LoadContent(ContentManager Content, string ModelPath)
		{
			Model = Content.Load<Model>(ModelPath);
		}
		public void Update(GameTime gameTime)
		{
			Position = new Vector3((int)((MouseCursor.Position.X - 400) / 14), 0.9f, ((int)(MouseCursor.Position.Y - 200) / 14));
			Position = Position * 14;
		}
		public void Draw(SpriteBatch spriteBatch)
		{
			Transforms = new Matrix[Model.Bones.Count];
			Model.CopyAbsoluteBoneTransformsTo(Transforms);
			foreach (ModelMesh modelMesh in Model.Meshes)
			{
				foreach (BasicEffect Effect in modelMesh.Effects)
				{
					//Effect.EnableDefaultLighting();
					//Effect.PreferPerPixelLighting = true;
					Effect.World = Transforms[modelMesh.ParentBone.Index] *
											Matrix.CreateRotationX(MathHelper.ToRadians(Rotation.X)) *
											Matrix.CreateRotationY(MathHelper.ToRadians(Rotation.Y)) *
											Matrix.CreateRotationZ(MathHelper.ToRadians(Rotation.Z)) *
											Matrix.CreateTranslation(Position);
					Effect.Projection = ProjectionMatrix;
					Effect.View = ViewMatrix;
				}
				modelMesh.Draw();
			}
		}
	}
}


#7FantasyVII

Posted 15 October 2012 - 04:45 PM

Hello everyone,

So I have this cube that I made in Sketchup and I applied a 4096 X 4096 texture on it. Here how it looks in Sketchup:-
Posted Image


and here is how the original texture looks:-
Posted Image


and here how it looks in my game:-
Posted Image


I just want to know why does it look so so bad?

here is the Cube Class when it load and draw the cube.
namespace _3D_Tower_Defense
{
class CubeModel
{
Model Model;
public Vector3 Position, Rotation;
Matrix ViewMatrix, ProjectionMatrix;
Matrix[] Transforms;
public CubeModel()
{
Rotation = Vector3.Zero;
}
public void Initialize(GraphicsDeviceManager graphics, Matrix ViewMatrix, Matrix ProjectionMatrix)
{
this.ViewMatrix = ViewMatrix;
this.ProjectionMatrix = ProjectionMatrix;
}
public void LoadContent(ContentManager Content, string ModelPath)
{
Model = Content.Load<Model>(ModelPath);
}
public void Update(GameTime gameTime)
{
Position = new Vector3((int)((MouseCursor.Position.X - 400) / 14), 0.9f, ((int)(MouseCursor.Position.Y - 200) / 14));
Position = Position * 14;
}
public void Draw(SpriteBatch spriteBatch)
{
Transforms = new Matrix[Model.Bones.Count];
Model.CopyAbsoluteBoneTransformsTo(Transforms);
foreach (ModelMesh modelMesh in Model.Meshes)
{
foreach (BasicEffect Effect in modelMesh.Effects)
{
//Effect.EnableDefaultLighting();
//Effect.PreferPerPixelLighting = true;
Effect.World = Transforms[modelMesh.ParentBone.Index] *
Matrix.CreateRotationX(MathHelper.ToRadians(Rotation.X)) *
Matrix.CreateRotationY(MathHelper.ToRadians(Rotation.Y)) *
Matrix.CreateRotationZ(MathHelper.ToRadians(Rotation.Z)) *
Matrix.CreateTranslation(Position);
Effect.Projection = ProjectionMatrix;
Effect.View = ViewMatrix;
}
modelMesh.Draw();
}
}
}
}

namespace _3D_Tower_Defense
{
	class CubeModel
	{
		Model Model;
		public Vector3 Position, Rotation;
		Matrix ViewMatrix, ProjectionMatrix;
		Matrix[] Transforms;
		public CubeModel()
		{
			Rotation = Vector3.Zero;
		}
		public void Initialize(GraphicsDeviceManager graphics, Matrix ViewMatrix, Matrix ProjectionMatrix)
		{
			this.ViewMatrix = ViewMatrix;
			this.ProjectionMatrix = ProjectionMatrix;
		}
		public void LoadContent(ContentManager Content, string ModelPath)
		{
			Model = Content.Load<Model>(ModelPath);
		}
		public void Update(GameTime gameTime)
		{
			Position = new Vector3((int)((MouseCursor.Position.X - 400) / 14), 0.9f, ((int)(MouseCursor.Position.Y - 200) / 14));
			Position = Position * 14;
		}
		public void Draw(SpriteBatch spriteBatch)
		{
			Transforms = new Matrix[Model.Bones.Count];
			Model.CopyAbsoluteBoneTransformsTo(Transforms);
			foreach (ModelMesh modelMesh in Model.Meshes)
			{
				foreach (BasicEffect Effect in modelMesh.Effects)
				{
					//Effect.EnableDefaultLighting();
					//Effect.PreferPerPixelLighting = true;
					Effect.World = Transforms[modelMesh.ParentBone.Index] *
											Matrix.CreateRotationX(MathHelper.ToRadians(Rotation.X)) *
											Matrix.CreateRotationY(MathHelper.ToRadians(Rotation.Y)) *
											Matrix.CreateRotationZ(MathHelper.ToRadians(Rotation.Z)) *
											Matrix.CreateTranslation(Position);
					Effect.Projection = ProjectionMatrix;
					Effect.View = ViewMatrix;
				}
				modelMesh.Draw();
			}
		}
	}
}


#6FantasyVII

Posted 15 October 2012 - 04:44 PM

Hello everyone,

So I have this cube that I made in Sketchup and I applied a 4096 X 4096 texture on it. Here how it looks in Sketchup:-
Posted Image


and here is how the original texture looks:-
Posted Image


and here how it looks in my game:-
Posted Image


I just want to know why does it look so so bad?

here is the Cube Class when it load and draw the cube.

namespace _3D_Tower_Defense
{
    class CubeModel
    {
	    Model Model;
	    public Vector3 Position, Rotation;
	    Matrix ViewMatrix, ProjectionMatrix;
	    Matrix[] Transforms;
	    public CubeModel()
	    {
		    Rotation = Vector3.Zero;
	    }
	    public void Initialize(GraphicsDeviceManager graphics, Matrix ViewMatrix, Matrix ProjectionMatrix)
	    {
		    this.ViewMatrix = ViewMatrix;
		    this.ProjectionMatrix = ProjectionMatrix;
	    }
	    public void LoadContent(ContentManager Content, string ModelPath)
	    {
		    Model = Content.Load<Model>(ModelPath);
	    }
	    public void Update(GameTime gameTime)
	    {
		    Position = new Vector3((int)((MouseCursor.Position.X - 400) / 14), 0.9f, ((int)(MouseCursor.Position.Y - 200) / 14));
		    Position = Position * 14;
	    }
	    public void Draw(SpriteBatch spriteBatch)
	    {
		    Transforms = new Matrix[Model.Bones.Count];
		    Model.CopyAbsoluteBoneTransformsTo(Transforms);
		    foreach (ModelMesh modelMesh in Model.Meshes)
		    {
			    foreach (BasicEffect Effect in modelMesh.Effects)
			    {
				    //Effect.EnableDefaultLighting();
				    //Effect.PreferPerPixelLighting = true;
				    Effect.World = Transforms[modelMesh.ParentBone.Index] *
										    Matrix.CreateRotationX(MathHelper.ToRadians(Rotation.X)) *
										    Matrix.CreateRotationY(MathHelper.ToRadians(Rotation.Y)) *
										    Matrix.CreateRotationZ(MathHelper.ToRadians(Rotation.Z)) *
										    Matrix.CreateTranslation(Position);
				    Effect.Projection = ProjectionMatrix;
				    Effect.View = ViewMatrix;
			    }
			    modelMesh.Draw();
		    }
	    }
    }
}


#5FantasyVII

Posted 15 October 2012 - 04:44 PM

Hello everyone,

So I have this cube that I made in Sketchup and I applied a 4096 X 4096 texture on it. Here how it looks in Sketchup:-
Posted Image


and here is how the original texture looks:-
Posted Image


and here how it looks in my game:-
Posted Image


I just want to know why does it look so so bad?

here is the Cube Class when it load and draw the cube.

asasas
as
as
a
s
as


#4FantasyVII

Posted 15 October 2012 - 04:43 PM

Hello everyone,

So I have this cube that I made in Sketchup and I applied a 4096 X 4096 texture on it. Here how it looks in Sketchup:-
Posted Image


and here is how the original texture looks:-
Posted Image


and here how it looks in my game:-
Posted Image


I just want to know why does it look so so bad?

here is the Cube Class when it load and draw the cube.

namespace _3D_Tower_Defense
{
	class CubeModel
	{

		Model Model;
		public Vector3 Position, Rotation;
		Matrix ViewMatrix, ProjectionMatrix;
		Matrix[] Transforms;

		public CubeModel()
		{
			Rotation = Vector3.Zero;
		}

		public void Initialize(GraphicsDeviceManager graphics, Matrix ViewMatrix, Matrix ProjectionMatrix)
		{
			this.ViewMatrix = ViewMatrix;
			this.ProjectionMatrix = ProjectionMatrix;
		}

		public void LoadContent(ContentManager Content, string ModelPath)
		{
			Model = Content.Load<Model>(ModelPath);
		}

		public void Update(GameTime gameTime)
		{
			Position = new Vector3((int)((MouseCursor.Position.X - 400) / 14), 0.9f, ((int)(MouseCursor.Position.Y - 200) / 14));
			Position = Position * 14;
		}

		public void Draw(SpriteBatch spriteBatch)
		{
			Transforms = new Matrix[Model.Bones.Count];
			Model.CopyAbsoluteBoneTransformsTo(Transforms);
			foreach (ModelMesh modelMesh in Model.Meshes)
			{
				foreach (BasicEffect Effect in modelMesh.Effects)
				{
					//Effect.EnableDefaultLighting();
					//Effect.PreferPerPixelLighting = true;
					Effect.World = Transforms[modelMesh.ParentBone.Index] *
											Matrix.CreateRotationX(MathHelper.ToRadians(Rotation.X)) *
											Matrix.CreateRotationY(MathHelper.ToRadians(Rotation.Y)) *
											Matrix.CreateRotationZ(MathHelper.ToRadians(Rotation.Z)) *
											Matrix.CreateTranslation(Position);

					Effect.Projection = ProjectionMatrix;
					Effect.View = ViewMatrix;
				}
				modelMesh.Draw();
			}
		}
	}
}



#3FantasyVII

Posted 15 October 2012 - 04:43 PM

Hello everyone,

So I have this cube that I made in Sketchup and I applied a 4096 X 4096 texture on it. Here how it looks in Sketchup:-
Posted Image


and here is how the original texture looks:-
Posted Image


and here how it looks in my game:-
Posted Image


I just want to know why does it look so so bad?

here is the Cube Class when it load and draw the cube.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Engine.IO;
namespace _3D_Tower_Defense
{
	class CubeModel
	{

		Model Model;
		public Vector3 Position, Rotation;
		Matrix ViewMatrix, ProjectionMatrix;
		Matrix[] Transforms;

		public CubeModel()
		{
			Rotation = Vector3.Zero;
		}

		public void Initialize(GraphicsDeviceManager graphics, Matrix ViewMatrix, Matrix ProjectionMatrix)
		{
			this.ViewMatrix = ViewMatrix;
			this.ProjectionMatrix = ProjectionMatrix;
		}

		public void LoadContent(ContentManager Content, string ModelPath)
		{
			Model = Content.Load<Model>(ModelPath);
		}

		public void Update(GameTime gameTime)
		{
			Position = new Vector3((int)((MouseCursor.Position.X - 400) / 14), 0.9f, ((int)(MouseCursor.Position.Y - 200) / 14));
			Position = Position * 14;
		}

		public void Draw(SpriteBatch spriteBatch)
		{
			Transforms = new Matrix[Model.Bones.Count];
			Model.CopyAbsoluteBoneTransformsTo(Transforms);
			foreach (ModelMesh modelMesh in Model.Meshes)
			{
				foreach (BasicEffect Effect in modelMesh.Effects)
				{
					//Effect.EnableDefaultLighting();
					//Effect.PreferPerPixelLighting = true;
					Effect.World = Transforms[modelMesh.ParentBone.Index] *
											Matrix.CreateRotationX(MathHelper.ToRadians(Rotation.X)) *
											Matrix.CreateRotationY(MathHelper.ToRadians(Rotation.Y)) *
											Matrix.CreateRotationZ(MathHelper.ToRadians(Rotation.Z)) *
											Matrix.CreateTranslation(Position);

					Effect.Projection = ProjectionMatrix;
					Effect.View = ViewMatrix;
				}
				modelMesh.Draw();
			}
		}
	}
}

PARTNERS