How can I make backgrounds ?

Started by
9 comments, last by Ineluki 22 years, 6 months ago
I want to peplace the black background with textures. How can I do that ? I have 6 square sized bitmaps witch I intended to use for it -> front, right, back, left, top and bottom. I want to make a 360° panorama viewer. Thanx for your help and sorry for my bad English. Post Scriptum: Loading the Texture is NOT my problem. I just don''t know how to assign them to the background. I tried to assign them to a cube and view it from inside, but even with glDisable(GL_FACE_CULLING) nothing was displayed.
Advertisement
Somewhere in the back of my mind, I don''t think you should try to set the background... Just create several quads that are textured, and linked... And create a really fuzzy algorithm to link them together, since you shouldn''t rotate, just move over them (ie. all the quads are on the same plane)
tex4---tex5---tex6---tex4---tex5---tex6---tex4---tex5---tex6 |      |      |      |      |      |      |      |      |tex1---tex2---tex3---tex1---tex2---tex3---tex1---tex2---tex3 |      |      |      |      |      |      |      |      |tex4---tex5---tex6---TEX4===TEX5===TEX6---tex4---tex5---tex6 |      |      |      ||     ||     ||     |      |      |tex1---tex2---tex3---TEX1===TEX2===TEX3---tex1---tex2---tex3 |      |      |      |      |      |      |      |      |tex4---tex5---tex6---tex4---tex5---tex6---tex4---tex5---tex6 |      |      |      |      |      |      |      |      |tex1---tex2---tex3---tex1---tex2---tex3---tex1---tex2---tex3

the ones in bold are the starting 6 textures (you might want to do 3 rows and 2 columns). then, when you move the camera (lets say we''re going right), when TEX4 and TEX1 are off the screen, you draw them next to TEX3 and TEX6. do the same when looking up/down.

crap explaination i know, but i hope you get the idea.

MENTAL
Hmmm... Let''s call front 1, left 2, back 3, right 4, top 5 and bottom 6, and assuming you can rotate up, left, right and down...

Though one Would have to do that per texture

When looking at 1:
up = going to 5
down = going to 6
left = going to 2
right = going to 4

When looking at 2:
up = going to 5
down = going to 6
left = going to 3
right = going to 5

When looking at 3:
up = going to 5
down = going to 6
left = going to 4
right = going to 2

When looking at 4:
up = going to 4
down = going to 6
left = going to 3
right = going to 1

When looking at 5:
up = turning 180 degrees.
Down = going to 1, 2, 3 or 4
Left = spinning left
Right = spinning right

When looking at 6:
See 5, switch up and down

It would also require you to ''rotate'' the textures, ''cause the top of 1 is connected to the bottom of 5, the top of 2 is connected to the left of 5, etc. etc.

Just try to imagine it...
@Ronin_54

I think thats not exactly what I intended.
I want to view it from any angle (e.g. alpha=45°; beta=-12.756°).
It should be just like in some ID-Games (e.g. Quake) except you can not move around.

Thx for your suggestions so far.

Ineluki
I solved my problem.
I simply forgot to switch back to Modelview by glMatrixMode(GL_MODELVIEW)

Thanx to all who helped me

That''s the illusion I created.

You can''t just create a box with six textures, and put the camera inside it.

By linking the six textures in the right order, you can (by moving around in 2d) get the *illusion* you are looking around in 3d.
quote:
You can''t just create a box with six textures, and put the camera inside it.


Why not? I tried it once and it worked very well, though I didn''t go far with it.

------------
- outRider -
I think you will loose quite a lot of perspective :D
Explain, I''m not sure what the problem with that method would be. Would it be the fact that the texture would seem stretched at the corners of the cube or what?

------------
- outRider -

This topic is closed to new replies.

Advertisement