Author Topic: X_WORLD2SCREEN - Not working on iPad  (Read 3353 times)

Offline Qube

  • Mr. Polyvector
  • ***
  • Posts: 157
    • View Profile
X_WORLD2SCREEN - Not working on iPad
« on: 2011-Aug-16 »
Hi,

The X_WORLD2SCREEN command functions perfectly on PC as expected but the coordinates on the iPad seem to be at 0,0,0.

If possible could this bug be fixed asap as I would like to release my game soon, pretty please  :P

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10817
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: X_WORLD2SCREEN - Not working on iPad
« Reply #1 on: 2011-Aug-17 »
oh no. Can't be. Can you make a tiny example to test?

Offline Qube

  • Mr. Polyvector
  • ***
  • Posts: 157
    • View Profile
Re: X_WORLD2SCREEN - Not working on iPad
« Reply #2 on: 2011-Aug-17 »
Here you go, here's a working small example that's as should be on PC but not on the iPad - on the ipad X_WORLD2SCREEN coordinates end up at 0,0,0  :'(

Could I be a pain and ask for a quick fix please as my game really needs to be out the door soon, thanks  :good:

Code: (glbasic) [Select]
SETSCREEN 640,480, 0

CreateCube(1, 20, RGB(0, 0, 255))

LOCAL phi% = 0
LOCAL x%, y%, z%, sx#, sy#, sz#
LOCAL sx1#, sx2#, sx3#, sy1#, sy2#, sy3#

WHILE TRUE
X_MAKE3D 1, 2500, 45
X_CAMERA 0,0,120, 0,0,0
X_CULLMODE 1
X_AMBIENT_LT 0, RGB(255,255,255)
X_SPOT_LT 1, RGB(0, 0, 255), 0, 1, -1, 0, -1, 1, 180

y = 0
z = 0

FOR x = -40 TO 40 STEP 40
X_MOVEMENT x, y, z
X_ROTATION phi, 0, 1, 1
X_DRAWOBJ 1, 0

X_WORLD2SCREEN x, y, z, sx, sy, sz

IF x = -40
sx1 = sx
sy1 = sy
ENDIF
IF x = 0
sx2 = sx
sy2 = sy
ENDIF
IF x = 40
sx3 = sx
sy3 = sy
ENDIF

INC y, 5
DEC z, 50
NEXT

INC phi, 2

X_MAKE2D

PRINT "cube 1 ", sx1, sy1
PRINT "cube 2 ", sx2, sy2
PRINT "cube 3 ", sx3, sy3

SHOWSCREEN
WEND

FUNCTION CreateCube: num, sz, col
X_AUTONORMALS 1
sz = sz / 2

X_OBJSTART num
// Front Face
X_OBJADDVERTEX  sz, -sz,  sz, 1, 0, col
X_OBJADDVERTEX -sz, -sz,  sz, 0, 0, col
X_OBJADDVERTEX  sz,  sz,  sz, 1, 1, col
X_OBJADDVERTEX -sz,  sz,  sz, 0, 1, col
X_OBJNEWGROUP
// Back Face
X_OBJADDVERTEX -sz,  sz, -sz, 1, 1, col
X_OBJADDVERTEX -sz, -sz, -sz, 1, 0, col
X_OBJADDVERTEX  sz,  sz, -sz, 0, 1, col
X_OBJADDVERTEX  sz, -sz, -sz, 0, 0, col
X_OBJNEWGROUP
// Top Face
X_OBJADDVERTEX -sz,  sz,  sz, 0, 0, col
X_OBJADDVERTEX -sz,  sz, -sz, 0, 1, col
X_OBJADDVERTEX  sz,  sz,  sz, 1, 0, col
X_OBJADDVERTEX  sz,  sz, -sz, 1, 1, col
X_OBJNEWGROUP
// Bottom Face
X_OBJADDVERTEX  sz, -sz, -sz, 0, 1, col
X_OBJADDVERTEX -sz, -sz, -sz, 1, 1, col
X_OBJADDVERTEX  sz, -sz,  sz, 0, 0, col
X_OBJADDVERTEX -sz, -sz,  sz, 1, 0, col
X_OBJNEWGROUP
// Right face
X_OBJADDVERTEX  sz,  sz, -sz, 1, 1, col
X_OBJADDVERTEX  sz, -sz, -sz, 1, 0, col
X_OBJADDVERTEX  sz,  sz,  sz, 0, 1, col
X_OBJADDVERTEX  sz, -sz,  sz, 0, 0, col
X_OBJNEWGROUP
// Left Face
X_OBJADDVERTEX -sz, -sz,  sz, 1, 0, col
X_OBJADDVERTEX -sz, -sz, -sz, 0, 0, col
X_OBJADDVERTEX -sz,  sz,  sz, 1, 1, col
X_OBJADDVERTEX -sz,  sz, -sz, 0, 1, col
X_OBJNEWGROUP
X_OBJEND
ENDFUNCTION

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3375
  • Integrated Brain
    • View Profile
Re: X_WORLD2SCREEN - Not working on iPad
« Reply #3 on: 2011-Aug-17 »
About this command, it´s hard , it´s have resitance.
If anyone needs something similar, but I think it´s more slower, I use a simple rule of 3, and works, very fine, only you have to change the increments of movement for every resoltion of the screen

Offline Qube

  • Mr. Polyvector
  • ***
  • Posts: 157
    • View Profile
Re: X_WORLD2SCREEN - Not working on iPad
« Reply #4 on: 2011-Aug-18 »
Tried the latest 10.084 of GLB which states iPhone / iPad X_WORLD2SCREEN fix. Unfortunately it still has the exact same problem  :'( :'( :'(

Works fine on PC but not on the iPad  :'( :'(

Offline Qube

  • Mr. Polyvector
  • ***
  • Posts: 157
    • View Profile
Re: X_WORLD2SCREEN - Not working on iPad
« Reply #5 on: 2011-Aug-20 »
Any progress on squashing this bug, Kitty? :) - poke poke nudge nudge  :P

Offline Qube

  • Mr. Polyvector
  • ***
  • Posts: 157
    • View Profile
Re: X_WORLD2SCREEN - Not working on iPad
« Reply #6 on: 2011-Aug-23 »
Blatant bump time  :nana:

Any update on this?

MrTAToad

  • Guest
Re: X_WORLD2SCREEN - Not working on iPad
« Reply #7 on: 2011-Aug-23 »
I think poor old Gernot is a bit busy at the moment...

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10817
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: X_WORLD2SCREEN - Not working on iPad
« Reply #8 on: 2011-Aug-24 »
was just an #ifdef - fixed in next update (these days).

Offline Qube

  • Mr. Polyvector
  • ***
  • Posts: 157
    • View Profile
Re: X_WORLD2SCREEN - Not working on iPad
« Reply #9 on: 2011-Aug-30 »
Confirmed that 10.090 fixed the issue.. Many thanks, Kitty  :good: