<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Direct3D 10 </title><link>http://forums.xna.com/forums/29.aspx</link><description>Only questions about the Direct3D 10 API are permitted here.</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: Sprite scaling</title><link>http://forums.xna.com/forums/thread/198798.aspx</link><pubDate>Sun, 12 Jul 2009 15:53:56 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:198798</guid><dc:creator>legalize</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/198798.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=29&amp;PostID=198798</wfw:commentRss><description>&lt;p&gt;Looking at the documentation for &lt;code&gt;ID3DX10Sprite&lt;/code&gt;, its not clear what coordinate space the &lt;code&gt;TexSize&lt;/code&gt; member is using.  However, I don&amp;#39;t see how scaling by a factor of 2.0 is going to be correct.  If your intention is to match the 1024x768 image 1:1 to the 800x600 window, then you need to scale it by 800/1024 (which is the same as 600/768) if we were talking about a coordinate space in pixels.&lt;/p&gt;
&lt;p&gt;However, getting the right transformation requires knowing what coordinate space you&amp;#39;re starting with since transformations map from one coordinate space to another.  You can&amp;#39;t get the desired output if you don&amp;#39;t know what input coordinate system is being used.&lt;/p&gt;</description></item><item><title>Re: Sprite scaling</title><link>http://forums.xna.com/forums/thread/198499.aspx</link><pubDate>Sat, 11 Jul 2009 10:22:52 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:198499</guid><dc:creator>TordinBjorn</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/198499.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=29&amp;PostID=198499</wfw:commentRss><description>To me it sounds logical, if you have 800x600 pixels, how can you render a 1024x768 pixel texture? impossible to view it all atone since you don&amp;#39;t have pixel to cover the entire texture! so you have to reduce the pixels to show the entire texture.&lt;br /&gt;
&lt;br /&gt;
but what the problem is i don&amp;#39;t understand, that your texture is beeing reduced to the half scale? or is somthing else happening?&lt;br /&gt;</description></item><item><title>Sprite scaling</title><link>http://forums.xna.com/forums/thread/186700.aspx</link><pubDate>Sat, 06 Jun 2009 13:54:44 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:186700</guid><dc:creator>Nightmare</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/186700.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=29&amp;PostID=186700</wfw:commentRss><description>This might been asked/answered before, but done quick search and could not find.&lt;br /&gt;
&lt;br /&gt;
Im currently working on a 2D gui system for D3D10 and looking into using sprites instead of vertex buffer i lock/update each control be drawed.&lt;br /&gt;
I pretty much copied the code from the DXUT framework to get my sprite drawn but noticed something strange about the sprite scaling.&lt;br /&gt;
&lt;br /&gt;
My application is running in windowed mode: 800x600&lt;br /&gt;
I have a texture loaded to use as background (fill entire render screen) wich is: 1024x786 dimension.&lt;br /&gt;
&lt;br /&gt;
This is my code for drawing the background image:&lt;br /&gt;
Notice the line: &lt;span style="font-size:13px;"&gt;D3DXMatrixScaling( &amp;amp;matScaling, 2.0f, 2.0f, 1.0f );&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
So am i doing something wrong here or is it normal that the scale must be 2.0 for filling the entire screen?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size:13px;"&gt;g_pSprite-&amp;gt;Begin( 0 );&lt;br /&gt;
&lt;br /&gt;
g_pEffect-&amp;gt;GetTechniqueByIndex( 0 )-&amp;gt;GetPassByIndex( 0 )-&amp;gt;Apply( 0 );&lt;br /&gt;
&lt;br /&gt;
D3DXMATRIXA16 matScaling;&lt;br /&gt;
D3DXMATRIXA16 matTranslation;&lt;br /&gt;
D3DXMatrixScaling( &amp;amp;matScaling, 2.0f, 2.0f, 1.0f );&lt;br /&gt;
D3DXMatrixTranslation( &amp;amp;matTranslation, 0.0f, 0.0f, 0.5f );&lt;br /&gt;
&lt;br /&gt;
D3DX10_SPRITE Sprite;&lt;br /&gt;
Sprite.matWorld = matScaling * matTranslation;&lt;br /&gt;
Sprite.pTexture = g_pTexture;&lt;br /&gt;
Sprite.TexCoord.x = 0.0f;&lt;br /&gt;
Sprite.TexCoord.y = 0.0f;&lt;br /&gt;
Sprite.TexSize.x = 1.0f;&lt;br /&gt;
Sprite.TexSize.y = 1.0f;&lt;br /&gt;
Sprite.TextureIndex = 0;&lt;br /&gt;
Sprite.ColorModulate = D3DXCOLOR( 1.0f, 1.0f, 1.0f, 0.5f );&lt;br /&gt;
&lt;br /&gt;
g_pSprite-&amp;gt;DrawSpritesBuffered( &amp;amp;Sprite, 1 );
&lt;p&gt;g_pSprite-&amp;gt;End();&lt;/p&gt;
&lt;/span&gt;</description></item></channel></rss>