# Moving scenario

Hi, I’m new in this Panda world and I’m having a bit of a problem :oops: :
In one of my VW(here on class) I’m trying to use one model, a floor model (just a plane with some irregularities)to cover the whole world.
The thing is, I’m using this specified model, but it doesn’t cover all the ground in the world. So I thought I could use the same piece of geometry and repeat it several times (or instance it) to cover the whole area without using too much resources.
So, is there a way to this dinamically? or another approach I could use without needing a gargantuan floor (that also means a gargantuan amount of time to load) to cover the whole area. I’ve tried this last approach, and yes, it’s madly big the loading time not to tell that it may not even cover the whole area (yes, it is a big world) and so you can see the end of the model on the horizon or something like that.

Any enlightment is much appreciated.

Thanks in advanced

-Roger

One thing you could do is have several pieces of floor that you move around depending on where the character/camera is to give the illusion that it goes on forever.

For example you might make a 3x3 grid of floor tiles that are 100 units wide. Your character’s position is (20, 50, 1) (Z-up coordinate), use division and convert to integer to determine the “tile coordinate” of the center floor piece (int(20 / 100), int(50 / 100)) = (0, 0). So the center floor piece gets positioned at (0 * 100, 0 * 100) = (0, 0) and the rest placed around the center in the grid.

Now you just need a task to run and determine if the tile coordinate changed. So if the character moves to (107, 340, 1), the tile coordinate is (int(107 / 100), int(340 / 100)) = (1, 3), and the center floor piece gets positioned at (1 * 100, 3 * 100) = (100, 300).

This is essentially a super simple streaming world, it’s just that all the parts of the world look the same.

I think this is posted in the wrong forum; it probably belongs in Scripting Issues instead. This forum is intended for people posting working examples.

How many times do you need to repeat the model? 100 times? 1,000? How long does it take to load it that many times? It shouldn’t really be that expensive to load a model repeatedly, because Panda only actually hits the disk the first time, and thereafter it just returns a fast copy.

But you’ll always be able to see the end of the model in front of the horizon, because the horizon is infinitely far away and you’re not going to be able to load an infinite number of your models. The trick is to make the end of the model look like it is the horizon. One way to do this would be to have a skydome that cuts off the floor plane at a certain distance (thus bringing the horizon in to a specified, finite distance).

David

Indeed, this is just in the wrong forum.
I thought I was under Scripting Issues, and then I saw your reply to find myself amused of my clumsiness.
Seriously I’m sorry, and please if any moderator can handle this issue, I’ll be deeply thankful. Again, sorry for my slip.

And for the answers, the one gave is to constantly move the center of the object? That’s what I get from the method. To put a task behind that continously moves the center of the ground model to be under the character.
If that so, I got it, and thank you very much. Sound quite accurate and I’ll try it very soon.

And thanks for the enlightment in the way panda handles things about render and models. That quite solves the thing. I’m only left with the doubt if there’s a way (inside Panda) to know the width (and length and height) of the object, so I can know how to reinstantiate (?) the models at the according coordinates.

Again, I may sound exaggerate, but I’m serioulsy thankful. I’m on a deadline and this solves many problems. Thanks a lot, again.

-Roger

You can use model.getTightBounds() to return the bounding rectangle of the object (as two VBase3’s). But if you created the model, you presumably already know how big it is.

David

Not exactly. You don’t want to move the floor exactly with the character; you want have a grid of floor tiles and shift that grid of floor tiles by increments of however wide the tiles are. This way it appears the floor is stationary.

Loading many models would give you a very large floor but you could never make it endless that way.