Share via

how to create this 3d image using direct 3d?

mc 6,841 Reputation points
2026-03-21T12:21:37.37+00:00

User's image

I want to create this 3d image using direct3d.

then I can rotate and click the sub image in it.

should I :

1.create this using other 3d software and then using direct3d?

2.just create them using direct3d? but how to add the light ?

Windows development | Windows API - Win32
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Taki Ly (WICLOUD CORPORATION) 150 Reputation points Microsoft External Staff Moderator
    2026-03-23T07:37:40.87+00:00

    Hello @mc ,

    If you want something close to the reference image, I would recommend creating the models and scene layout in other 3D software first, then using Direct3D to render it and handle rotation and click interaction. For lighting, in Direct3D you usually add it in the shaders.

    This is a minimal sample from my side. You can follow a similar approach to add lighting in your project:

    cbuffer LightBuffer : register(b0)
    {
        float3 lightDir;
        float  pad;
        float4 lightColor;
    };
    
    struct PS_INPUT
    {
        float4 pos    : SV_POSITION;
        float3 normal : NORMAL;
    };
    
    float4 main(PS_INPUT input) : SV_TARGET
    {
        float3 n = normalize(input.normal);
        float3 l = normalize(-lightDir);
    
        float diffuse = max(dot(n, l), 0.0f);
        return lightColor * diffuse;
    }
    

    I hope this information helps with your question. If you found my response helpful, you can follow this guide to leave feedback.

    Thank you.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.