Author Topic: 3D Display problem ?  (Read 4239 times)

MrTAToad

  • Guest
3D Display problem ?
« on: 2012-Feb-23 »
I have my 3D camera at 0.0,30.0,0.0 -> 0.0,-100.0,0.0 and for some reason nothing is displayed.  Change the Z value to anything and all the objects are displayed for some reason

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3372
  • Integrated Brain
    • View Profile
Re: 3D Display problem ?
« Reply #1 on: 2012-Feb-23 »
Perhaps whit this values you are into the 3D objetcs... and if the normals not are displayed in both sides perhaps it´s this...

The diferender of the y in the camera and the Target not it´s too much

0.0,30.0,0.0 -> 0.0,-100.0,0.0

Another thing... I don´t rebember if it´s the same case than you, but try something like this...
0.1,30.0,0.0 -> 0.0,-100.0,0.0

Only change a little the parameter them are equal... I rebember I have trobles whit this... some similar to my post about (Rgb(x,x,x))

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 932
  • KodeSource
    • View Profile
    • KodeSource
Re: 3D Display problem ?
« Reply #2 on: 2012-Feb-23 »
Strange.  So you're looking straight down, in the center of the world (x,z)?
Is this related to some kind of 'gimbal lock' style bug?
Maybe the 'camera up' vector is screwed up?
For an experiment, you could try adding this before 'X_CAMERA':
Code: (glbasic) [Select]
X_CAMERAUP 1,0,0
Ha, I really have no idea what this will do, just throwing out some debugging ideas.
But, you'd still thing GLBasic should handle this situation.
Maybe Gernot could detect this situation, and slip in a '0.0000001' for one of the x or z values.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

MrTAToad

  • Guest
Re: 3D Display problem ?
« Reply #3 on: 2012-Feb-23 »
Perhaps whit this values you are into the 3D objetcs... and if the normals not are displayed in both sides perhaps it´s this...

The diferender of the y in the camera and the Target not it´s too much

0.0,30.0,0.0 -> 0.0,-100.0,0.0

Another thing... I don´t rebember if it´s the same case than you, but try something like this...
0.1,30.0,0.0 -> 0.0,-100.0,0.0

Only change a little the parameter them are equal... I rebember I have trobles whit this... some similar to my post about (Rgb(x,x,x))
The trouble with using a non X or Z value is that, whilst everything does look fairly straight, you can see it is at an angle...

Quote
Strange.  So you're looking straight down, in the center of the world (x,z)?
Is this related to some kind of 'gimbal lock' style bug?
I was wondering that too

At the moment, I'm doing it along the Z value instead - had to rotate my graphics, but aside from that it works okay.


Offline Marmor

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 925
  • 96A285CC
    • View Profile
    • my youtube channel
Re: 3D Display problem ?
« Reply #4 on: 2012-Feb-23 »
also play with camerarange

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
Re: 3D Display problem ?
« Reply #5 on: 2012-Feb-24 »
Can not confirm your problem, you camera coordinates work for me. maybe you need to take care, that your objects get in range?
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

MrTAToad

  • Guest
Re: 3D Display problem ?
« Reply #6 on: 2012-Feb-24 »
Oh yes, it's all in range and will display when the Z value is set to something like 0.1

Another problem - is X_SCREENTOWORLD working properly - it seems to be returning values that have no real relation to actual 3D coordinates :

Quote
-1.384185482e-002
-1.384185482e-002
-1.012185649e-002

When the actual coordinate should be around -15 and -11

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
Re: 3D Display problem ?
« Reply #7 on: 2012-Feb-24 »
Oh i just realized that i tested with X_CAMERAUP, in this case it is working (just set it to 0,0,1 or 1,0,0). Without changing the camera up vector it doesnt show any object. Changing the up vector is better than adding an offset.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

MrTAToad

  • Guest
Re: 3D Display problem ?
« Reply #8 on: 2012-Feb-24 »
Yes, I'll probably have to use that.

SCREEN2WORLD is being a bit odd.

If sz<0 then I get a decent range of positions, but the step value between then is well over double the width of the object for some reason...
If sz>0 then I get the very small x and y positions...

« Last Edit: 2012-Feb-24 by MrTAToad »

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1545
    • View Profile
Re: 3D Display problem ?
« Reply #9 on: 2012-Feb-24 »
I've always had to move the camera target by a fraction to get a top view.

Code: (glbasic) [Select]
X_CAMERA 0.0, 30.0, 0.0  ,0.001, -100.0, 0.0


Offline UBERmonkeybot

  • Mr. Polyvector
  • ***
  • Posts: 243
    • View Profile
Re: 3D Display problem ?
« Reply #10 on: 2016-Jan-24 »
I just came across this problem.