RE: Surely a simple prob i hope
- From: Brook <Brook@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 13 Jun 2006 06:45:02 -0700
Hi Daniel,
Just in response to the 790/800 pixel issue. I experienced the same thing
and although i never really looked into it, i think it was due to the window
having a 5 pixel border to the left and right (adding up to 10 pixels). This
meant that only 790 pixels were actually being displayed. I may be wrong
though :)
ta,
Brook
"Daniel" wrote:
Hey guys.
I have a few issues all of which are strange so i hope someone can clarify
fo rme.
First of all i have a windowed app, 800 x 600 in size.
I write all my mouse positions to the console verytime i move the mouse and
i find when i move th emouse to the far right edge of my window it goes to
790...but not 800?
Next i draw a sprite at position 500,0,0
Then draw some 2d text at the same position 500,0
Yet on the screen the 2d text appears about 60pixels more across.
The 2D text seems to be accurate, if i set it to 790 it goes right at the
edge of my form, as you would expect after the first weird issue of the edge
being 790 instead of 800.
So why does my sprite not position correctly? ALso note it is not a set
offset, the more i move the sprite across the further the gap between it and
the text.
I am guessing my sprite is being drawn in a different acis or something and
i need it to match the one the 2d text is following. how do i do this???
please help
This is my code to initialise my perspective view.
// Set transforms
device.Transform.World = Matrix.Identity;
device.Transform.View = Matrix.Identity;
float aspect = (float)_displaySize.Width / (float)_displaySize.Height;
device.Transform.Projection = Matrix.PerspectiveFieldOfViewLeftHanded(
(float)Math.PI / 3.0f, aspect, 0.1f, 1000.0f );
float centerX = (float)_displaySize.Width / 2.0f;
float centerY = (float)_displaySize.Height / 2.0f;
Vector3 cameraPosition = new Vector3(centerX, centerY, -10.0f);
Vector3 cameraTarget = new Vector3(centerX, centerY, 0.0f);
device.Transform.View = Matrix.LookAtLeftHanded(cameraPosition,
cameraTarget, new Vector3(0.0f, 1.0f, 0.0f));
device.Transform.Projection =
Matrix.OrthoLeftHanded((float)_displaySize.Width,
(float)_displaySize.Height, 1.0f, 10.0f);
// Set render states
device.RenderState.Lighting = false;
- Follow-Ups:
- Re: Surely a simple prob i hope
- From: Daniel
- Re: Surely a simple prob i hope
- References:
- Surely a simple prob i hope
- From: Daniel
- Surely a simple prob i hope
- Prev by Date: Surely a simple prob i hope
- Next by Date: Re: Surely a simple prob i hope
- Previous by thread: Surely a simple prob i hope
- Next by thread: Re: Surely a simple prob i hope
- Index(es):
Relevant Pages
|