I can't see my objects!!!

edited February 2012 in Help request
This is my configuration file:
[Viewport]
Camera               = Camera
BackgroundColor      = (0, 0, 0)

[Camera]
FrustumWidth         = @Display.ScreenWidth
FrustumHeight        = @Display.ScreenHeight
FrustumFar           = 1000.0 
Position             = (0.0, 0.0, 0.0)

[Input]
SetList           = InputSet1
 
[InputSet1]
KEY_LEFT  = GoLeft
KEY_RIGHT = GoRight
KEY_UP    = ScaleUp
KEY_DOWN  = ScaleDown
MOUSE_LEFT = ButtonLeft
KEY_RETURN = Select

[PrincipalMusic]
Music = res/snd/principal.wav
Loop = true

[BackgroundGraphic]
Texture = res/img/boceto.png
Pivot = center

[BackgroundObject]
Graphic = BackgroundGraphic
Position = (0.0, 0.0, 1.0)

[ButtonGraphic]
Texture = res/img/button-1.png
Pivot = center

[ButtonGraphicSelected]
Texture = res/img/button-1-s.png
Pivot = center

[ButtonObjExit]
Graphic = ButtonGraphic
Position = (470.0, 388.0, 2.0)

[ButtonObjJugar]
Graphic = ButtonGraphic
Position = (8.0, 388.0, 1.0)

I see "BackgroundObject" but i can't see "ButtonObjJugar" and "ButtonObjExit"...

Ideas?

Comments

  • edited February 2012
    First thing that comes to mind, what are the values of Display.ScreenWidth & Display.ScreenHeight?

    I'm asking as your camera is centered in (0, 0, 0) and both buttons use a Y = 388.0, which means that the FrustumHeight of your camera needs to be at least 776 to have their center barely in screen (I don't know how large they are).

    Have you tried replacing the button graphic with the background one to rule out some issue with the bitmaps button-1.png and button-1-s.png?

    And lastly, which version of orx do you use and on which platform? :)
  • edited February 2012
    Hi! :)

    a)
    [Display]
    ScreenWidth   = 800
    ScreenHeight  = 600
    

    b)what is FrustumHeight ?

    c) i don't understand, sorry :( (google translator is very bad)

    d) Windows, and i can't compile orx from source, so i'm using 1.3.

    button-1.png and button-1-s.png size: 120x60
  • edited February 2012
    Hello Luciano,

    Try moving your object [ButtonObjExit] and [ButtonObjJugar] much closer to 0,0. At the moment they are both outside your viewing boundaries.

    Frustum is the shape of the area that the camera can see.

    Be aware, your camera points at the 0,0 location in the world. The location '0x,0y' is in the center of your screen. Up and Left are negative numbers, Down and Right are positive numbers.

    In your layout the bottom right corner of your screen will see 400x , 300y.

    Edit: Many of us here speak multiple languages, so if you tell us yours, we may be able to help without using google translate. :)
  • edited February 2012
    Hello Grey, and thanks! I moved my buttons to 0, 0, <some> and i moved background to 1234,1234,... and works!

    My new problem: the object "BackgroundGraphic" is about the buttons.
    [BackgroundGraphic]
    Texture = res/img/boceto.png
    Pivot = center
    
    [BackgroundObject]
    Graphic = BackgroundGraphic
    Position = (0.0, 0.0, 1.0)
    
    [ButtonGraphic]
    Texture = res/img/button-1.png
    Pivot = center
    
    [ButtonGraphicSelected]
    Texture = res/img/button-1-s.png
    Pivot = center
    
    [ButtonObjExit]
    Graphic = ButtonGraphic
    Position = (0.0, 0.0, 2.0)
    
    [ButtonObjJugar]
    Graphic = ButtonGraphic
    Position = (8.0, 0.0, 0.0)
    

    And just in case, I speak Spanish.

    Thanks for helping!
  • edited February 2012
    Hi luciano,

    So the camera frustum is what you defined here:
    [Camera] 
    FrustumWidth         = @Display.ScreenWidth 
    FrustumHeight        = @Display.ScreenHeight 
    FrustumFar           = 1000.0  
    Position             = (0.0, 0.0, 0.0) 
    

    By doing so, you define how much of the world the camera will "see". The widht&height defines the 2D rectangle (X-Y axes) of the world it'll see and the near/far will determine how much on the Z axis will be seen.

    You have a far = 1000 and a position of (0, 0, 0) which means your camera sees objects with a Z that complies with 0 < z <= 1000.

    Now if we look at your config, you have:
    - ObjJugar.Z = 0
    - Background.Z = 1
    - ObjExit.Z = 2

    That means that ObjExit will be rendered behind Background and will thus be obstructed by it.

    ObjJugar won't be rendered because it's Z = 0 and doesn't fit in 0 < Z <= 1000.

    Hope this helps!

    PS: Sorry I don't speak Spanish at all but maybe someone else here does!
  • edited February 2012
    I Iarwain, and thanks for helping.

    It is very understandable what you say, but I do not understand is why doesn't work. I don't know what is wrong, now see only the buttons :(
    [Viewport]
    Camera               = Camera
    BackgroundColor      = (0, 0, 0)
    
    [Camera]
    FrustumWidth         = @Display.ScreenWidth
    FrustumHeight        = @Display.ScreenHeight
    FrustumFar           = 1000.0 
    Position             = (0.0, 0.0, 0.0)
    
    [Input]
    SetList           = InputSet1
     
    [InputSet1]
    KEY_LEFT  = GoLeft
    KEY_RIGHT = GoRight
    KEY_UP    = ScaleUp
    KEY_DOWN  = ScaleDown
    MOUSE_LEFT = ButtonLeft
    KEY_RETURN = Select
    
    [PrincipalMusic]
    Music = res/snd/principal.wav
    Loop = true
    
    [BackgroundGraphic]
    Texture = res/img/boceto.png
    Pivot = center
    
    [BackgroundObject]
    Graphic = BackgroundGraphic
    Position = (0.0, 0.0, 0.0)
    
    [ButtonGraphicInactive]
    Texture = res/img/button-1.png
    Pivot = (0, 0, 0)
    
    [ButtonGraphicActive]
    Texture = res/img/button-1-s.png
    Pivot = (0, 0, 0)
    
    [ButtonObjExit]
    Graphic = ButtonGraphicInactive
    Position = (100.0, 148.0, 1.0)
    AnimationSet = ButtonAnimationSet
    AnimationActive = ButtonActive
    AnimationInactive = ButtonInactive
    
    [ButtonObjJugar]
    Graphic = ButtonGraphicInactive
    Position = (-312.0, 148.0, 1.0)
    AnimationSet = ButtonAnimationSet
    AnimationActive = ButtonActive
    AnimationInactive = ButtonInactive
    
    [ButtonAnimationSet]
    AnimationList = ButtonActive#ButtonInactive
    LinkList = ButtonInactiveLoop#ButtonInactive2Active#ButtonActiveLoop#ButtonActive2ButtonInactive
    
    [ButtonActive]
    DefaultKeyDuration  = 0.5
    KeyData1            = ButtonGraphicActive
    KeyData2            = ButtonGraphicActive
     
    [ButtonInactive]
    DefaultKeyDuration  = 0.5
    KeyData1            = ButtonGraphicInactive
    KeyData2            = ButtonGraphicInactive
     
    [ButtonInactiveLoop]
    Source      = ButtonInactive
    Destination = ButtonInactive
     
    [ButtonInactive2Active]
    Source      = ButtonInactive
    Destination = ButtonActive
    Property = immediate
     
    [ButtonActiveLoop]
    Source      = ButtonActive
    Destination = ButtonActive
     
    [ButtonActive2ButtonInactive]
    Source      = ButtonActive
    Destination = ButtonInactive
    Property = immediate
     
    
  • edited February 2012
    luciano wrote:
    I Iarwain, and thanks for helping.

    Sure, no problem!
    It is very understandable what you say, but I do not understand is why doesn't work. I don't know what is wrong, now see only the buttons :(

    Mmh, I guess it's because I wasn't clear enough in my explanation. Let's try another time. :)
    [Camera]
    FrustumFar           = 1000.0 
    Position             = (0.0, 0.0, 0.0)
    

    The above part puts the Camera at Z = 0 (let's not care about X/Y for now).
    It can see as far as 1000 away from where it's placed.
    So the camera sees object whose Z > 0 (not Z >= 0) and Z <= 1000.
    [BackgroundObject]
    Position = (0.0, 0.0, 0.0)
    

    Here BackgroundObject is set with Z = 0. It's too close from the camera and won't get rendered. Z *needs* to be > 0 in your case.
    [ButtonObjExit]
    Position = (100.0, 148.0, 1.0)
    
    [ButtonObjJugar]
    Position = (-312.0, 148.0, 1.0)
    

    Here both objects have Z = 1 which satisfy 0 < Z <= 1000, so you're fine.

    If you want your background to appear behind your buttons, its Z needs to be > 1.

    And now some ASCII art! :)

    You want something like this
    Cam vision: ]--------------------------------------------]
    Obj:        |        Button1       Background            |
                |        Button2          |                  |
                |          |              |                  |
    Depth (Z):  0          Z1             Z2                1000
    
    So if you pick any Z1 & Z2 with 0 < Z1 < Z2 <= 1000 it'll work.
  • edited February 2012
    Well, your explanation is very clear! even for me that I do not quite understand your language!

    My problem is solved! Thank you very much!
  • edited February 2012
    I'm glad the second explanation did the trick!

    And no worries for the language, my native language isn't English either and it's the same for a lot of people around here. :)
Sign In or Register to comment.