Jump to content

  • Log In with Google      Sign In   
  • Create Account


leonard2012

Member Since 19 Mar 2012
Offline Last Active Feb 10 2014 06:39 AM

Topics I've Started

3D complex polygons rendering on a sphere with GLU tessellation routines

17 December 2013 - 09:30 AM

In my app, I need to render complex polygons representing e.g. continents, rainfall regions on the Earth surface. The Earth is simulated with a bi-tangent sphere like Google Earth. In 2D orthogonal projection, I can render complex polygons with GLU tessellation routines (gluTessNew, gluTessCallback and so on). When I do the same in 3D perspective projection, most of the part of a polygon except the boundary is occluded by the sphere surface. The cause of the error is that all the vertices of a tessellated polygon lie on a plane, and this plane is behind the spherical surface of the Earth. I really appreciate if someone could recommend some hints on how to accomplish the task.


Viable 3D text rendering solution for DirectX11

01 December 2013 - 08:42 AM

I need to draw text in 3D perspective scene. The text can be rotated/translated/scaled so that it can be drawn with desired position and orientation. Is there any viable solutions to my issue? thanks.


3D text rendering with DirectX Toolkit's SpriteFont

30 November 2013 - 10:11 AM

I am trying to implement text/symbol rendering in 3D perspective projection setup using DirectXTK's SpriteBatch/SpriteFont. I've searched the web on related topics and found two helpful articles [1],[2].
To experiment with walbourn's code given in [2], I start with the DirectXTK simple sample [3]. I want to change the code so that the Windows logo and the text "DirectXTK Simple Sample" take on a 3D perspective feel of look. The only changes I've made so far is in function Renderer::Render() of file Renderer.cpp. In details, I pass an transform matrix as the function argument to Renderer::Render.
```
    // Draw sprite
    XMMATRIX world = XMLoadFloat4x4( &m_world );
    XMMATRIX view = XMLoadFloat4x4( &m_view );
    XMMATRIX projection = XMLoadFloat4x4( &m_projection );
    XMMATRIX local = XMMatrixMultiply( world, XMMatrixTranslation( -2.f, -2.f, -4.f ) );
    XMMATRIX worldViewProj = local * view * projection;

    m_sprites->Begin(DirectX::SpriteSortMode_Deferred, nullptr, nullptr, nullptr, nullptr, nullptr, worldViewProj);
    //m_sprites->Begin();
    m_sprites->Draw( m_texture2.Get(), XMFLOAT2(10,75), nullptr, Colors::White );
    m_font->DrawString( m_sprites.get(), L"DirectXTK Simple Sample", XMFLOAT2( 100, 10 ), Colors::Yellow );
    m_sprites->End();
```
The rendering result is apparently wrong as both logo and text are invisible at first and then become rays of light staring from the top-left corner of the screen, and then disappear again at the end of animation period. Could someone tell me what's wrong with my code. How to change the code so that the logo and the text are rendered on the surface of the tea pot or character face? Thank you in advance.

 

[1] SpriteBatch billboards in a 3D world. http://blogs.msdn.com/b/shawnhar/archive/2011/01/12/spritebatch-billboards-in-a-3d-world.aspx?PageIndex=2.
[2] SpriteBatch.Begin()
https://directxtk.codeplex.com/discussions/459391.
[3] DirectXTK Simple Sample (Windows 8.1)
http://code.msdn.microsoft.com/DirectXTK-Simple-Sample-a0b6de36.

 

PS: I've posted this question on MSDN a few days ago but got no reply yet. Sorry for the repetition.


Does Direct2D support stencil test

20 March 2013 - 03:47 PM

In my app I use stencil test to restrict the graphics rendering inside a specified region. I use both Direct3D (for geometries) and Direct2D (for fonts) drawing functions. The issue is that the stencil test has no effect on Direct2D functions. This is unexpected as Direct2D is based on Direct3D. I just want to know if stencil test is supported in Direct2D, and will review my code to find bugs if it is supported. Otherwise, how can I implement similar feature to stencil test in Direct2D?


Stencil test stop working when geometry shader is enabled

07 January 2013 - 10:02 AM

I use stencil test to restrict rendering of graphics objects to be inside a region. The works when geometry shader is set to NULL. However when I set the geometry shader, the stencil test seems to stop working for objects passed through geometry shader. and it only works for objects that does not pass throught the GS (e.g. texture). Could someone kindly tell me what's wrong.

PARTNERS