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.

DarkBASIC Discussion / 3D image generation for background - need help

Author
Message
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 2nd Jul 2009 01:53
Hey guys and girls!

I have a small problem. You all know how to render a background and slap it on a plain object so it looks 3D. That's all fine and good, but my problem comes when I go a step further. Now I want to render a full 360° surround image in one big strip, and texture it onto an inverted cylinder around my level, so the background looks 3D, but doesn't take up too much processing power.

When I did this, I noticed that the perspective of an image taken straight in front of the camera is different than if I take the same image of the scene from the side of the camera. Because of this, the 360° image strip is all screwed up and doesn't look 3D at all, but more like a few plain objects thrown together.

How can I make a strip like this? A step might be to set the camera to orthographic, but I wouldn't have a clue how to do that...

Any help is greatly appreciated!

TheComet


Make the path of your enemies easier with Waypoint Pro!
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 2nd Jul 2009 02:01
I figured out how they did that type of setup in a real game, was actually quite ingenious.

way off in space, there is a small 3d model of the background. A camera is placed in the center and pointed in the same direction as the game's camera. A screenshot is taken and the Backdrop is textured with it. That will give you a 3d like background without the need of a huge object around your level.

With DBC, you would have to position your camera, snap a picture then place it back, which I think can be done with minimal performance hit, but you would have to try it to be sure.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 2nd Jul 2009 02:10
That's very interesting. I guess the thread was right in Geek Culture. Programmers are becoming lazier and lazier... I'll try it next morning. BTW, did you hack a game to figure that out?

Thanks, BN2!

TheComet


Make the path of your enemies easier with Waypoint Pro!
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 2nd Jul 2009 02:15
Actually, I got board and turned off the clipping and just flew out as far as I could past the game level (there was a point when the background stopped refreshing correctly and just started trailing. The only things that didn't smear were 3D models, which is how I found the hidden model. It took me a little while to figure out what it was there for, though I almost immediately realized it was a model that was somehow used for the background image.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 2nd Jul 2009 02:18
That's a very complicated way of doing it and I'm not sure it'd work better.. There's a lot of better ways that are easier to program and don't murder performance. For a start, move the sky object with the player but don't touch its angle. Leave it at 0,0,0. Spheres or cubes are usually best for sky objects.

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 2nd Jul 2009 02:35
Hmmm just was trying to get it to work, the problem I ran into is that GET IMAGE requires an immediate SYNC afterwards to work right. This makes it difficult to work with since you will get a flicker from the camera moving (the game obviously used 2 cameras, which could be done in PRO). You could probably work it out by making a function that will grab the screen using memblocks, though that is a bit beyond me at the moment.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 2nd Jul 2009 03:34
TheComet

Can't you create the image in your 3d app? I think many of them have methods for creating sky boxes or sky spheres. You'd have to adapt it to your cylinder.

And if you are trying to capture a 360 degree image in DBC, you do realize the screen has a FOV of about 62 degrees? So you could either change the FOV, or capture the screen in 61.93072209 degree increments. In all cases, you have to make sure the image is complete - doesn't have and blank edges and it doesn't overlap itself.

Enjoy your day.

Login to post a reply

Server time is: 2024-05-20 11:39:30
Your offset time is: 2024-05-20 11:39:30