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. C#
  4. DirectX programing C# (Camera rotation)

DirectX programing C# (Camera rotation)

Scheduled Pinned Locked Moved C#
helpcsharpgraphicsgame-dev
2 Posts 2 Posters 0 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.
  • D Offline
    D Offline
    Debjit_625
    wrote on last edited by
    #1

    Help..Help...Help.. :zzz: Hi My name is Debjit ,I am trying move and rotate a Camera in a 3d sean.I am programing in C# using DirectX SDK.The problem is that when I rotate the camera and try to move the camera forward in z direction it goes z direction but facing on some other side because of the target position. I know that i am not so clear but if anyone understood please help me. Thanks Debjit_625 Debjit_625

    P 1 Reply Last reply
    0
    • D Debjit_625

      Help..Help...Help.. :zzz: Hi My name is Debjit ,I am trying move and rotate a Camera in a 3d sean.I am programing in C# using DirectX SDK.The problem is that when I rotate the camera and try to move the camera forward in z direction it goes z direction but facing on some other side because of the target position. I know that i am not so clear but if anyone understood please help me. Thanks Debjit_625 Debjit_625

      P Offline
      P Offline
      pbalaga
      wrote on last edited by
      #2

      What you mean saying the camera is "facing on some other side"? Actually, you didn't write what you want to achieve. Do you want the camera to point always the same direction? If so, you may need to recreate projection matrix, which contains the look at point of the camera. Direction vector of the camera is : dir = lookAt - position. After you store it, you can calculate new look at point from any position: newLookAt = newPosition + dir Did I help you?

      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