GLBasic forum

Feature request => 3D => Topic started by: MrTAToad on 2009-Jan-16

Title: Camera
Post by: MrTAToad on 2009-Jan-16
Would be nice if you could rotate the camera in X, Y and/or Z directions
Title: Re: Camera
Post by: Schranz0r on 2009-Jan-16
SIN() and COS() ;)
Title: Re: Camera
Post by: WPShadow on 2009-Jan-17
Und was ist mit denen von uns, die zu doof dafür sind? z.B. ich? (traurig aber wahr)
Title: Re: Camera
Post by: Schranz0r on 2009-Jan-17
I can make some functions, if you want! No?
Title: Re: Camera
Post by: MrTAToad on 2009-Jan-17
If it can get around some gimbal locking that would be great.
Title: Re: Camera
Post by: WPShadow on 2009-Jan-17
Please make a function for "dummies" like me!!!  :good:
Title: Re: Camera
Post by: Kitty Hello 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




Title: Re: Camera
Post by: Kitty Hello on 2009-Jan-21
with the rotation matrix, I think it is solved. I admit I never really understood that problem, too. ;)
Title: Re: Camera
Post by: Quentin 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
Title: Re: Camera
Post by: Hemlos on 2009-Jan-25
Quote from: Ocean on 2009-Jan-23
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.