Author Topic: portals are the right thing for me?  (Read 3657 times)

Offline mogli

  • byte
  • *
  • Posts: 38
    • View Profile
portals are the right thing for me?
« on: June 02, 2006, 11:15:02 am »
Hi!

i have to visualize a large building which should be also reachable by low speed internet. that is at least the illusion ;)

so i split the complex into many rooms and floors etc.

to get right performance i stream the neighbour rooms of the room where i actually stand.
ok for the first room this works ;)

but now i want to change the room and stream the next neighbour rooms and possibly destroy some. i think i can use portals for this by placing the portals at the alley where the doors are placed.

may this the right beginning for my problem or could somebody give me a better approach?
 

PS: i know that i have to set portals by hand. but i save the rooms as strings in an array with their names in world, position for the lights and also coordinates for the portals. with another array (same size) i represent a tree of dependency of rooms in detail. a special function add and destroy the right rooms by handling with this array. hope it is to understand what i mean ;)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
portals are the right thing for me?
« Reply #1 on: June 02, 2006, 04:19:26 pm »
I'm not sure if you are thinking about portals in the same way as did when i added them. Portals in jPCT are for visibility determination only, i.e. parts of the geometry that are not visible through a portal will be clipped. This saves fillrate especially when using the software renderer. They can't be used as a kind of "magic" transition between sectors. Or in other words: everything that can be done with portals can be done without them. There won't be a visible difference.
If that's what you mean, then the answer is a clear: maybe! Portals are in jPCT but haven't really been used by anybody in the last years (at least none that i know of). So i'm not 100% sure, that if i haven't broken them somewhere on the way. But if they fit your needs, you may give them a try. If they fail, you can still continue by disabling portals and let me fix the bugs... :wink:
But again: From your post, i'm not sure if this is, what you have in mind... :?:

Offline mogli

  • byte
  • *
  • Posts: 38
    • View Profile
portals are the right thing for me?
« Reply #2 on: June 02, 2006, 04:49:30 pm »
hmm, when i get your post right my idea about using portals is not really good.

i need something that gives me an event if the user get at a certain place. in my example at the position where a door is placed.

the user walks starts at a room (entrance). the neighbour rooms (of the neighbour) are already available. then the user passed a certain place (door) i need an event that i have to load the neighbour rooms of this new room and destroy some of the "old" available rooms.

hope, now, it's better to understand what i need. ;)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
portals are the right thing for me?
« Reply #3 on: June 02, 2006, 07:54:55 pm »
A simple distance check between the player's/camera's position and the stored position of the door should do. Are the doors open or closed? If they are closed and act as a "beamer" between the rooms, a collision event should also work fine.

Offline mogli

  • byte
  • *
  • Posts: 38
    • View Profile
portals are the right thing for me?
« Reply #4 on: June 02, 2006, 08:58:49 pm »
some doors are open and some are closed.

but the idea with the collision even could be the my answer of my problem ;)

is it possible to place some transparent objects at a world? so i could place the transparent objects at the position of the doors...but i think than i have to poll if a certain object is involved. :(

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
portals are the right thing for me?
« Reply #5 on: June 02, 2006, 11:43:35 pm »
Yes, you may work with invisible objects or, even better, with objects that are visible during collision detection only, i.e. set them to invisible when doing the rendering, set them visible before collision detection and invisible right after that. You can add a CollisionListener to any object that will be notified in case of a collision, so no polling is needed.

Offline mogli

  • byte
  • *
  • Posts: 38
    • View Profile
portals are the right thing for me?
« Reply #6 on: June 03, 2006, 08:21:14 am »
oh that's great.
i will test it.

have you planned to add sensors or something like this to jpct in future? i think this would also be a nice feature ;)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
portals are the right thing for me?
« Reply #7 on: June 03, 2006, 07:20:04 pm »
Quote from: "mogli"

have you planned to add sensors or something like this to jpct in future? i think this would also be a nice feature ;)
Not sure about it, because i think that it's drop dead easy to add something like this yourself...well....we'll see... :wink: