Author Topic: Camera  (Read 5854 times)

MrTAToad

  • Guest
Camera
« on: 2009-Jan-16 »
Would be nice if you could rotate the camera in X, Y and/or Z directions

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5024
  • O Rly?
    • View Profile
Re: Camera
« Reply #1 on: 2009-Jan-16 »
SIN() and COS() ;)
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline WPShadow

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1667
    • View Profile
    • http://lostrevenant.blogspot.com
Re: Camera
« Reply #2 on: 2009-Jan-17 »
Und was ist mit denen von uns, die zu doof dafür sind? z.B. ich? (traurig aber wahr)
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 10.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://lostrevenant.blogspot.com
alea iacta est

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5024
  • O Rly?
    • View Profile
Re: Camera
« Reply #3 on: 2009-Jan-17 »
I can make some functions, if you want! No?
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

MrTAToad

  • Guest
Re: Camera
« Reply #4 on: 2009-Jan-17 »
If it can get around some gimbal locking that would be great.

Offline WPShadow

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1667
    • View Profile
    • http://lostrevenant.blogspot.com
Re: Camera
« Reply #5 on: 2009-Jan-17 »
Please make a function for "dummies" like me!!!  :good:
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 10.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://lostrevenant.blogspot.com
alea iacta est

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10715
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Camera
« Reply #6 on: 2009-Jan-20 »
Really, it's easy, isn't it?

Code: GLBasic [Select]
X_CAMERA 0,0,distance_to_object, 0,0,0

// now make a rotation and translation matrix for the whole object
// -> the complete cube
LOCAL mat[]
MakeMatrix(rotx, roty, rotz, positionx, positiony, positionz, mat[])

// apply this matrix
X_MULTMATRIX mat[]
   // ok, keep the current matrix as a base
   X_PUSHMATRIX
   // draw all the sub-cubes, as if you were drawing them non rotated at position 0,0,0
   FOR i=0 TO 100
       X_MOVEMENT ...
       X_DRAWOBJ ...
   NEXT
   X_POPMATRIX
   SHOWSCREEN
 




Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10715
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Camera
« Reply #7 on: 2009-Jan-21 »
with the rotation matrix, I think it is solved. I admit I never really understood that problem, too. ;)

Offline Quentin

  • Prof. Inline
  • *****
  • Posts: 915
    • View Profile
Re: Camera
« Reply #8 on: 2009-Jan-23 »
I had the same problem trying to play building a little space shooter. With the entity system you're able to rotate around all three axis without probems. But I never understoud how it works  :S

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1635
  • Particle Hawk
    • View Profile
Re: Camera
« Reply #9 on: 2009-Jan-25 »
Hi Hemlos,

yes, I'm building a wooden canard airplane.  The design originates from France.  In Florida, especially a bit further south from you  -  near St. Sebastian  -  there should be flying around quite a few as one of the canard kit plane producers is located there.

As to sims:  I focus on X-Plane (for various reasons).   Is your sim programming project still alive?


Cool a pilot :)

I did attempt a 3d helicopter sim, even built a model for it...but, i havent been able to use the 3d entity system to synchronize all the moving parts to rotate together, and also, I have not been able to lock the camera into the cockpit either.

I need help with these issues, but its not something im too worried about right now.
Ive been pretty busy with the 3d font object creator program...nearly done.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)