Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: 3d panorama  (Read 9130 times)

0 Members and 1 Guest are viewing this topic.

neo83_gr

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 3
    • View Profile
    • civensoftware
3d panorama
« on: June 02, 2005, 10:31:48 AM »

i want to make a 1st person interface with 360 degrees rotation (you know : myst3,4 ....) using WME.I had the idea to disappear the actor (1st person) and then input a very wide scrolling backround.when we reach the right, moving from left to right ,(for example) edge-limit of the backround, the engine could load the backround again from the left egde.
I don't know if you get it.... ??? ???
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: 3d panorama
« Reply #1 on: June 02, 2005, 01:06:28 PM »

I'd suggest having only one background image, where the left and right edges would overlap (i.e. part of the left edge would be copied to the right side of the image). Then some script would control the image shifting, and it would periodically check the current scroll position. Now when the position is above a certain value (i.e. when it reaches the overlapping area) the script would set the position back to the left edge of the image. I think something like that might work.

I hope that makes some sense...
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: 3d panorama
« Reply #2 on: July 29, 2005, 03:04:54 PM »

Mnemonic can you detail this futhur with some demo code??

A test picture and test code would be great and I am sure the forum members would like this in their adventures or even the hole adventure made of it.


Could you also look up and down??




Cheers
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 690
    • View Profile
Re: 3d panorama
« Reply #3 on: July 30, 2005, 03:57:18 AM »

Mnemonic can you detail this futhur with some demo code??
A test picture and test code would be great and I am sure the forum members would like this in their adventures or even the hole adventure made of it.

*hem*
Actually Mnemonic already gave all necessary information to check it out, if he'd write all plugins and game codes himself, he couldn't develop the engine anymore. ;) (And some "please" might be nice, too... >:D)

But well ok, I needed something to relax anyway, this is the result of a 20 minutes try-out.

http://wme.jerrot.de/panorama.zip (about 1 MB)

I never played Myst, so I don't know exactly how it should work, but this example is so simple and dirty ;) that the only code I'm going to publish of it for now is the following short part in the game_daemon.script. Maybe I'll clean it up and publish it in the "Scripts, plugins, utilities, goodies" section when I've got more time (marrying in two weeks...).

I had a little problem with setting the Scene.OffsetX, so basically I decided simply to move the invisible actor on left-click to that position by SkipTo(). [e.g. I changed the scene.script and replaced GoTo by SkipTo and saved the clicked x/y coordinates in two variables, because I need them to calculate the new position - where the engine should scroll to - after a "walk over the borders".]

Ok, and here is the short part how to check the borders:

Code: [Select]
var i = 0;
while (true)
{
    ...
   
    // this is only necessary because - for whatever reason - Scene.OffsetX
    // is not initialized to its correct value in the first iteration of this loop.
    if(i==0) { i = 1; Sleep(100); continue; }

    // checking if we reached the left border:
    if (Scene.OffsetX == 0)
    {
        Scene.OffsetX = 2000;
actor.SkipTo(posX+1600, posY);
        Sleep(10);
        continue;
    }
    // checking if we reached the right border:
    if (Scene.OffsetX == 1600)
    {
Scene.OffsetX = 0;
actor.SkipTo(posX-1600, posY);
    }
    Sleep(10);
}

The values depend on your resolution and the picture size of course. But that's all.

And this is the picture I used (small version). Actually it's too small, but it works anyway as example. You will see, that the first 800 pixels (which is the game width resolution) are exactly the same as the last 800 pixels, everything in between is normal scrolling anyway.



Could you also look up and down??

Yes, the standard WME behaviour remains.
Enjoy.
« Last Edit: July 30, 2005, 09:38:23 AM by Jerrot »
Logged
Mooh!

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: 3d panorama
« Reply #4 on: July 30, 2005, 12:36:47 PM »

and this example Jerrot kindly provided to everyone is fine example why WME is not suited for this kind of games
(who need 360 degrees panorama anyway?)

Engines you are looking for are doing this differently (trust me I was into it some time ago before I realized that I really don't like 360 degrees panorama) They do the following: For simple tube mapping (eg. you are inside of tube and turn around left and right,
it has to make perspective correction for the sides, otherwise it will look really distorted. For all views it use spherical texture mapping
you stand inside and map the texture on the inside of the sphere

For types of panoramic images look here: http://www.panoguide.com/howto/panoramas/types.jsp

Please use WME for what it's for. If you create 360 degrees panorama in WME, you will never get results like Myst or Atlantis. They really
use much more elaborate system of image calculation and that's the reason why it feels more *real*.  The most close impression
of doing this in WME would be Callahan Crosstime Saloon like gfx, which is exactly what Jerrot kindly coded for you.

If you want to know how such an image looks, look here where you find detailed reference how to code such a things:

http://astronomy.swin.edu.au/~pbourke/projection/spheretexture/

Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 690
    • View Profile
Re: 3d panorama
« Reply #5 on: July 30, 2005, 03:14:24 PM »

Hiya,

@meta: I agree with every word. And I don't like Myst anyway. ;)

Still - THIS is what's possible! (without patching the Direct3DDevice - no idea if it might work that way though, I never used the SDK before) It might be useful for some retro puzzle with retro graphics, where you walk in a circle and always only see the wall. :) But probably not for more indeed...

Logged
Mooh!
 

Page created in 0.041 seconds with 20 queries.