ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Tutorial 11: 2D Rendering 연습문제
    Directx 11 with rastertek 2022. 9. 11. 23:56

    To Do Exercises

    1. Recompile the code and ensure you get a 2D image drawn to the 100, 100 location on your screen.

    2. Change the location on the screen where the image is drawn to.

    3. Change the size of the image in the m_Bitmap->Initialize function call in the GraphicsClass.

    4. Change the texture that is used for the 2D image.

     

    1. 소스 코드를 다시 컴파일하고 화면상의 (100, 100) 위치에 2D 이미지가 그려지는지 확인해 보십시오.

     

    2. 이미지가 그려지는 위치를 바꿔 보십시오.

    graphicsclass.cpp

    bool GraphicsClass::Render(float rotation)
    {
    .....................생략....................
    		result = m_Bitmap->Render(m_D3D->GetDeviceContext(), 200, 300);
    .....................생략....................
    }

     

    출력좌표 (200, 300)

    3. GraphicsClass에서 m_Bitmap->Initialize 함수로 이미지의 크기를 바꿔 보십시오.

    graphicsclass.cpp

    bool GraphicsClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
    {
    .........................생략.........................
    	result = m_Bitmap->Initialize(m_D3D->GetDevice(), screenWidth, screenHeight,
        			L"../rastertek/data/seafloor.dds", 512, 512);
    .........................생략.........................
    }

    크기 256, 256 -> 512, 512로 변환

    4. 2D 이미지에 사용되는 텍스쳐를 바꿔 보십시오.

    graphicsclass.cpp

    bool GraphicsClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
    {
    .............................생략...........................
        result = m_Bitmap->Initialize(m_D3D->GetDevice(), screenWidth, screenHeight, 
        			L"../rastertek/data/coda.dds", 256, 256);
    .............................생략...........................
    }

    seafloor.dds -> coda.dds로 변환
    coda.dds
    0.04MB

Designed by Tistory.