Author Topic: Tiled texture on an infinitly big plane?  (Read 4306 times)

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
Tiled texture on an infinitly big plane?
« on: March 26, 2007, 09:13:16 pm »
G'day,
I'm trying to achieve a particular effect, and I'm not sure whether it's possible - and if it is, how it might be done. I'm open to blindingly obvious solutions which make me look like an idiot as well as cunningly clever solutions (although they may beg more questions).

So I have a user controlled camera (forward/backward/left/right) in an empty world. However, I'd like to give the user some kind of visual feedback for the movement of the camera. So for example, that they can see how quickly the camera is moving.
So what I was hoping to do was to apply a black/white tiled texture on to an entire plane (infinitely big in all directions). So no matter how far the camera moves, the user will continue to see the camera is moving.

Possible?

Cheers!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Tiled texture on an infinitly big plane?
« Reply #1 on: March 26, 2007, 11:06:11 pm »
No. Everything has to be build out of polygons. And a polygon can't have an infinite size. Even if it would have a very huge size, you'll run into accuracy errors sooner or later. I think that this effect can be simulated by either using multiple objects that switch positions when needed or by applying some kind of clever vertex controller which basically does the same thing in a more resource friendly way. However, both solutions are not trivial.

Offline Hrolf

  • int
  • **
  • Posts: 84
    • View Profile
Re: Tiled texture on an infinitly big plane?
« Reply #2 on: March 27, 2007, 04:55:37 pm »
There is a quick cheat! You can make a TextureEffect to scroll the texture of a large poly in the desired direction while the poly and camera stay still - I used this to give the impression of a boat travelling over water once...

Offline cyberkilla

  • float
  • ****
  • Posts: 413
    • View Profile
    • http://futurerp.net
Re: Tiled texture on an infinitly big plane?
« Reply #3 on: March 30, 2007, 08:09:57 pm »
That would be good for a starfield.
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

Offline Wojtek

  • int
  • **
  • Posts: 62
    • View Profile
Re: Tiled texture on an infinitly big plane?
« Reply #4 on: July 14, 2009, 09:54:13 pm »
Hello,

Recently I had a similar problem - how to create a textured world for my space game. I have read that thread, however what I needed was a little bit different than Mystara. I wanted to have a starfield that is not moving when starship is travelling, however it needs to look different if camera angle is changed.

I have created a solution that may be helpful for others too.

So what I did was to create a very big sphere (lets say with radius=1000), textured it and put camera inside it.

My game is working the way, that camera is always looking at player's ship from some specified distance (so in fact it is being moved with the spaceship during the game). Having that implemented I continueusly update the sphere center position to be the same as ship's one, so when ship is moving, the starfield looks the same from cameras perspective, however when camera angle is changed, it looks different.


I have uploaded an example with textured sphere and camera located in the sphere center. It is possible to use arrows to change camera angles and see how world texture is changing.
The example files can be downloaded from: working example with sources

Thanks,
Wojtek
« Last Edit: August 15, 2009, 09:28:02 pm by Wojtek »