Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. How to create complex 3d Objects with direct3d?

How to create complex 3d Objects with direct3d?

Scheduled Pinned Locked Moved Graphics
helptutorialquestion
1 Posts 1 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 12268183
    wrote on last edited by
    #1

    I would like to model the 3d object, consisted of two parts (A1 and A2). The angle between A1 and A2 is 150°. A1 and A2 are cylinders. The 3D object (A1 and A2) is lying on the XY plane.
    I would like to rotate the 3d object around the A1 axis. The render plane has to be XZ. I don’t know how to rotate the 3d object around A1 axis. I use different combinations of the following functions:

    D3DXMatrixRotationY(&R11, D3DX_PI * D3DXToRadian(0));
    D3DXMatrixRotationAxis(&A1, &D3DXVECTOR3 (0.0f, 1.0f, 0.0f), D3DXToRadian(30));
    D3DXMatrixRotationZ(&R12, D3DXToRadian(20));
    D3DXMatrixTranslation(&T11, 20.0f, 5.0f, 0.0f);
    D3DXMatrixRotationX(&R13, D3DXToRadian(40));
    HR(gd3dDevice->SetTransform(D3DTS_WORLD, &(R11 * A1 * R13/* * T11 * R13*/)));

    Unfortunately I don’t understand how to create a child object (A2). When I rotate the object A1, the child object A2 has to be rotated automatically around the A1 axis.

    Could you help to resolve the problem?

    Regards

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups