Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A 3D Theory...
#1
Okay, here's my little idea. I have finally figured out simple 3D graphics (TechFalcon pats himself on the back). However, when i discovered the way simple rotaions worked, I thought, "how do you rotate the camera?" So, I came up with this little idea. What if I simply first translate the world in coordination with the camera, and then rotate in the opposite direction? Would this work?
[Image: Signature.png]
Reply
#2
Hmm...intresting

Could you elaborate please?
Reply
#3
Okay, take a look at this diagram:

Code:
---------------------------------------------
|                                           |
|     |B|                                   |
|                                           |
|                                           |
|                           |C|             |
---------------------------------------------

Let's say this is a cheesy little level with a room and a cube (|B|).
The camera (|C|) will be at (0,0,0) and the cube will be at (10,0,5)
Now, if we only want to move the camera forward 5 units, then just SUBTRACT all the values of the world and other objects. Therefore, the camera would still be at (0,0,0), but the cube would be at (10,0,0).

Now for rotation to work, you first rotate the object around it's own axis, to get it oriented correctly. Then apply the main translation in coordination with the camera as I previously explained. And finally, rotate the objects that have been translated, in the opposite rotation to the camera.

That a good enough explanation!? Big Grin
[Image: Signature.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)