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 / Real-time Mirrors

Author
Message
Benji
19
Years of Service
User Offline
Joined: 17th Dec 2005
Location: Mount Doom
Posted: 17th Dec 2005 09:59
How would I make a real-time mirror that doesn’t ruin the frame rate? And how do I make it work correctly? I have tried putting
in the loop so that every loop the camera is moved and an image is taken and placed on object 14(the mirror). It is supposed to do correctly but instead the mirror shows whatever I am looking at in my original position. And the frame-rate is usually on average 15 . Can anyone help????
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 17th Dec 2005 13:21
Maybe you can try making a ghosted plain. And then duplicate all objects that have to be mirrored.
Mirror them around the plain to get the effect you want.



If you REALLY need to have reflections, without having to duplicate your objects, I would consider buying DBPro.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 17th Dec 2005 13:23
I too have experimented and I'm afraid it can't be done in DBC.

You need multiple cameras to do it - like you have in DBPro.

TDK_Man

Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 17th Dec 2005 15:56 Edited at: 17th Dec 2005 15:57
actually, DBPro has a better feature for this kind of problems. Reflective surfaces
Benji
19
Years of Service
User Offline
Joined: 17th Dec 2005
Location: Mount Doom
Posted: 17th Dec 2005 20:14
Quote: "Maybe you can try making a ghosted plain. And then duplicate all objects that have to be mirrored.
Mirror them around the plain to get the effect you want."


That probably wouldn't work. It would take too much positioning and when its done, it would probably look like a different room (on the other side of the plain). But thanks for the help .

Quote: "actually, DBPro has a better feature for this kind of problems. Reflective surfaces "


Do you mean a shiny surface or would it be a mirror?
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 18th Dec 2005 01:41
there is a real mirror code for dbc somewhere is the snippets forum
just google this site for dbc , mirror, code

[/center]
Benji
19
Years of Service
User Offline
Joined: 17th Dec 2005
Location: Mount Doom
Posted: 18th Dec 2005 05:23
Quote: "there is a real mirror code for dbc somewhere is the snippets forum
just google this site for dbc , mirror, code
"


Thanks I'll try!
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 18th Dec 2005 09:53 Edited at: 18th Dec 2005 10:00
Quote: "That probably wouldn't work. It would take too much positioning and when its done, it would probably look like a different room (on the other side of the plain). But thanks for the help ."


Au contraire, that would work just fine... If you want an example, check out the 'iced' demo included with DBC. If you look, the ice is acting like a mirror... All the objects above the ground are cloned below the ground, and a ghosted plain has been placed.

(Diagram is inexplicably 7kb)


Look at this top-down diagram of some random furniture scene, with a mirror on the wall. The red circles represent where a player object might stand, and the red dotted lines show where a ray of light could bounce directly into them. Having the two 'extremes' of these produced creates a nice ray of what should be able to be seen in the mirror (which I've coloured yellow). Some of the objects are only *just* touching the yellow, so you might be able to get away with not showing those.

If it's too much effort, you could just, (at game start) put the camera where the plain is but facing towards all the stuff, then sync, get image & texture it onto the plain.
It'll look flat, but it'd do.

Perhaps a combination of these effects could be achieved... If a mirror is far away, use the flat texturing but ghost it and 'show object' the furniture in the 'mirror' world if the player gets close enough...

P.S. Extra kudos if you could re-position some of the 'real' world objects into the mirror world without the user noticing (i.e., if there's any objects behind them then you could move the objects into the mirror world). But that just makes it stupidly difficult

16-colour PNGs pwn.
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 18th Dec 2005 13:43
Quote: "That probably wouldn't work. It would take too much positioning and when its done, it would probably look like a different room (on the other side of the plain). But thanks for the help "


Yes I see what you mean. It can be tricky to create a mirror without the mirror is perpendicular with the x/y/z axis.

BTW, to mirror polygon models that are loaded in the game, use scale object obj,-100,100,100 for mirrorring along the x-axis, scale object obj,100,100,-100 for mirrorring along the z-axis and scale object obj,100,-100,100 for mirrorring the object along the y-axis.
Benji
19
Years of Service
User Offline
Joined: 17th Dec 2005
Location: Mount Doom
Posted: 19th Dec 2005 04:53
I'll try....but it will take awhile for my project. . Then i'll show results.
Benji
19
Years of Service
User Offline
Joined: 17th Dec 2005
Location: Mount Doom
Posted: 24th Dec 2005 03:25
Too hard .... like i thought. Unless there is another solution , I have to quit.

Login to post a reply

Server time is: 2025-05-22 19:28:25
Your offset time is: 2025-05-22 19:28:25