Tag Info

Hot answers tagged

2

It is possible to just pass the Content Manager to your modules, and have them load their own textures/data. Its also tidier, as the Module is responsible for loading its own textures, and doesn't have to depend on its resources being loaded elsewhere. I do something similar - my data objects have a string specifying a texture/model, and my rendering code ...


1

I believe all you need for this is some ambient lighting (light that is allways there, even in the dark parts), and a diffuse light. Instead of enabling default lighting, call cubeEffect.LightingEnabled = true; cubeEffect.AmbientLightColor = new Vector3( 0.3f, 0.3f, 0.3f ); cubeEffect.DirectionalLight0.Enabled = true; ...


1

You need a directional lighting. Also disable specular lighting if you want screen position not to matter. This type of directional lighting is achieved by: float lighting = saturate(dot(normal,lightDirection)); But you can enable it in a BasicEffect, too. If you want speculars gone, turn down the material's specular intensity to zero (you can also do it ...


1

This is because the sprite batch hijacks the graphics device's states when you use it. You need to cache them before using the sprite batch and then restore them afterwards. (Or you can set them directly afterwards without caching if you know the ones you want to use.) // cache device states var blendState = GraphicsDevice.BlendState; var depthStencilState ...


1

So , as already was sad there are no pixels in 3D spcae at all. There are usints that dont have any relations with 2D pixels. Pixel are also units, but they have fixed size couse screen have have fixed resolution. For example if your monitor is 12 inches in width and 9 inches in height and resolutins is set to 800x600 one pixel will have real size ...


1

Like dustin said, the size of a 3d object isnt measured in pixels. But if you wish to scale it, change "world = Matrix.CreateTranslation(10.0f, 10.0f, 0.0f);" to "world = Matrix.CreateScale(2) * Matrix.CreateTranslation(10.0f, 10.0f, 0.0f);". Notice that I put the scale factor matrix BEFORE the translation. Otherwise, the translation would also get scaled. ...



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