Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6604413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:09:10+00:00 2026-05-25T19:09:10+00:00

I was wondering if there is any other method beside the classical DrawIndexedPrimitive DrawIndexedPrimitiveUP

  • 0

I was wondering if there is any other method beside the classical

DrawIndexedPrimitive
DrawIndexedPrimitiveUP
DrawPrimitive
DrawPrimitiveUP
DrawRectPatch
DrawTriPatch 

for drawing models on the screen.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:09:11+00:00Added an answer on May 25, 2026 at 7:09 pm

    if you mean that model is a mesh (set of vertex and textures) and you have file with that model you can try something like this:

    // Loading the mesh
    LPD3DXBUFFER materialBuffer = NULL;
    DWORD numMaterials = 0;
    LPD3DXMESH mesh = NULL;
    hr=D3DXLoadMeshFromX("d:\\temp\\tiger.x", D3DXMESH_SYSTEMMEM, 
        d3dDevice, NULL, 
        &materialBuffer,NULL, &numMaterials, 
        &mesh );
    if(FAILED(hr))
        THROW_ERROR_AND_EXIT("hr=D3DXLoadMeshFromX");
    
    // Loading the material buffer
    D3DXMATERIAL* d3dxMaterials = (D3DXMATERIAL*)materialBuffer->GetBufferPointer();
    // Holding material and texture pointers
    D3DMATERIAL9 *meshMaterials = new D3DMATERIAL9[numMaterials];
    LPDIRECT3DTEXTURE9 *meshTextures  = new LPDIRECT3DTEXTURE9[numMaterials];   
    // Filling material and texture arrays
    for (DWORD i=0; i<numMaterials; i++)
    {
        // Copy the material
        meshMaterials[i] = d3dxMaterials[i].MatD3D;
    
        // Set the ambient color for the material (D3DX does not do this)
        meshMaterials[i].Ambient = meshMaterials[i].Diffuse;
    
        // Create the texture if it exists - it may not
        meshTextures[i] = NULL;
        if (d3dxMaterials[i].pTextureFilename)
            D3DXCreateTextureFromFile(d3dDevice, d3dxMaterials[i].pTextureFilename, &meshTextures[i]);
    }
    
    materialBuffer->Release();
    
    //render mesh
    d3dDevice->Clear(0,NULL,D3DCLEAR_TARGET, D3DCOLOR_XRGB(255,255,255),1.0f,0);
                // Turn on wireframe mode
                d3dDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_WIREFRAME);
                d3dDevice->BeginScene();
            for (DWORD i=0; i<numMaterials; i++)
            {
                // Set the material and texture for this subset
                d3dDevice->SetMaterial(&meshMaterials[i]);
                d3dDevice->SetTexture(0,meshTextures[i]);
                // Draw the mesh subset
                mesh->DrawSubset( i );
            }
    
            d3dDevice->EndScene();
            d3dDevice->Present(NULL, NULL, NULL, NULL);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering if there is any other configuration options for a default controller.
I know and have Xcode, but I was wondering if there were any other
I was wondering if there was any decent way, other than NSLog-ing just about
I was wondering if there is any difference in performance (or any other important
I was wondering if there was any other way to keep users logged in
I was wondering if there is any civilized method of assembling SQL deployment scripts
Been wondering are there any ways to measure the learning performance of ANNs. Thanks
I was wondering - are there any known techniques to control access to a
I am wondering is there any way we can test the font size/color of
i just wondering is there any performance issue or anything thing wrong if that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.