Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Image problem in point-click adventure

Author
Message
Jan Eise
20
Years of Service
User Offline
Joined: 18th Dec 2003
Location:
Posted: 23rd Aug 2005 15:07
Hello everyone

I'm working on a point/click adventure, but I have a problem..
I made a 360 degree panaroma photo with my digital camera which is now one long .jpg file ( 10501x571 ). In the program, i want the player to be able to "look around", so the image should scroll across the screen.

How can I do this?

-J.E.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 23rd Aug 2005 17:08
That's indeed a very long jpg file.

If you are working in 3D, I would suggest you create a very big sphere and texture it with your background.

Else, I would split up you panorama in 2 and use the paste image id,x,y command to place your background.

when the first images is almost at the end, paste the second 1 after the first. When second is almost at the end, paste the first one after the sec, etc...

Immunity and Annihalation makes Immunihalation...
Jan Eise
20
Years of Service
User Offline
Joined: 18th Dec 2003
Location:
Posted: 23rd Aug 2005 18:50
Allright thnx, but how can I make an image scroll?
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Aug 2005 20:36 Edited at: 23rd Aug 2005 20:37
I don't think that would look too good mapped onto a sphere.

I would try exactly the same thing but with a cylinder - probably wouldn't get as much distortion as with the sphere.

Scale up the size of the cylinder and place the camera inside it and don't forget to turn the Cull flag on or you won't see anything.

You could then limit the camera tilt to stop anyone looking up too far and seeing the whole at the top of the cylinder.

TDK_Man

Jan Eise
20
Years of Service
User Offline
Joined: 18th Dec 2003
Location:
Posted: 23rd Aug 2005 21:23
I tried this, but the proportions are wrong...and the image quality is bad. I think scrolling the picture across the screen would get the best results.

Can anyone tell me how to do this?
xtom
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 24th Aug 2005 12:49 Edited at: 24th Aug 2005 12:49
If you want to keep the image flat there are 3 choices I can think of - a plain or a sprite and try scrolling the texture or use paste image. Not sure if any of them would work right. To be honest the cylinder idea sounds like the easiest way, perhaps try playing around with scaling the cylinder, make sure it's inside out with the camera inside. Perhaps not placing the camera at the center but closer to the viewing edge might give less distortion too. Make sure you texture it with the texture flag 1 set for no mip-mapping.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 24th Aug 2005 15:01 Edited at: 24th Aug 2005 15:04
If mapped onto a cylinder, the distortion would come into play if the cylinder's radius was too small. The bigger you scale it equally on the X and Z axis, the less distortion you would get as the projection surface gets less curved.

However, doing this would then stretch the image horizontally, but should be compenated for by scaling up equally on the Y axis too.

To answer your question, in 3D you need three plains, all the width and height of the image. In 2D, load the image three times - one into image 1, one into image 2 and one into image 3. The principal is the same whether working in 2D or 3D - you are just working with Plains in 3D and Images in 2D.

Paste image number 2 on the screen at 0,0. Paste image 1 to the left of image 2 at -imagewidth. If the image is 10501 pixels wide then paste it at -10501. Image 3, you paste at 10501.

But, it's done with variables:

Img1x = -10501
Img2x = 0
Img2x = 10501

Then use in your main loop:



The problem is, I'm not sure how DB is going to react to either the size of the image or the pasting of the image at such a distance off screen.

It works fine with -800 so you can scroll a full screen, but an image over 10K pixels wide is another story!

TDK_Man

Login to post a reply

Server time is: 2024-09-24 03:19:16
Your offset time is: 2024-09-24 03:19:16