Jump to content

  • Log In with Google      Sign In   
  • Create Account

Watermelon Chris

Member Since 07 Aug 2011
Offline Last Active Feb 20 2012 10:50 AM

Posts I've Made

In Topic: Drawing a linelist... Error about vertex declaration/shader and normal0 missing.

20 February 2012 - 10:51 AM


perhaps it would help if you showed the vertex declaration for VertexPositionColor and vertex shader code too?

Best regards!

The vertex declaration? I'm assuming it's this line (it's the second line in the SetupGrid() method):
gridVertices = new VertexPositionColor[lineCount * 4];

As for vertex shader code.. Uhm what where ?

In Topic: Model artifacts in XNA from blender

20 February 2012 - 10:48 AM

Are they facing the right way in blender? how do I check?

My 'bowl' is actually made from 1 'polygon/wall'. I'll try make another!

In Topic: Overlapping sprites with transparency

18 February 2012 - 11:24 AM

Nice graphics!

Anyway. One possible solution, you generate another 3 'blocks' yet the places where the overlap now you make half the opacity. You could then check when this situation occurs and hence replace the images with the 'half opacity' areas.

That's something I quickly thought up. But having it overlap doesn't look bad at all in my oppinion.

In Topic: Some questions about positioning/matricis/rotations

18 February 2012 - 10:05 AM

Thank you for your reply.

"All objects have their own world matrix, which translates, rotates, and scales the object relative to all the other objects in the scene."
So I need to create a matrix for each model?

Where is the monkey's matrix in this example? Is it creating a matrix automatically?
In which case if I were to add a second object/model, how would I modify the below?
Matrix[] transforms = new Matrix[monkey.Bones.Count];
		    float aspectRatio = graphics.GraphicsDevice.Viewport.AspectRatio;
		    Matrix projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f), aspectRatio, 1.0f, 10000.0f);
		    Matrix view = Matrix.CreateLookAt(cameraPosition, cameraView, Vector3.Up);
		    foreach (ModelMesh mesh in monkey.Meshes)
			    foreach (BasicEffect effect in mesh.Effects)
				    effect.View = view;
				    effect.Projection = projection;
				    effect.World = transforms[mesh.ParentBone.Index] * Matrix.CreateTranslation(monkeyPosition);

In Topic: XNA Access variables from base class in game component

08 November 2011 - 02:06 AM

Thanks I'll give that a go. :rolleyes: