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 / Question about mirrors...

Author
Message
Mike Inel
23
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Sa upuan ko po...
Posted: 4th Apr 2003 10:09
How will I make an object which has an effect of a mirror?
.....What?
Mike Inel
23
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Sa upuan ko po...
Posted: 4th Apr 2003 10:16
Use this for replies if someone or everyone is confused which topic will they answer. (hehe... really, I have no idea)

.....What?
Hell IVIonkey
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 4th Apr 2003 10:46
Simple and easy answer: you don't.

More complex answer that is very impractical: Calculate the reflected sight position and angle from each face, temporarily set the camera to that position and angle, take a snapshot via bitmap setting, put the camera back, texture the face of the object with the snapshot.

Don't bother without a portal system (not present in DB)... it was just fun to write out.

On the other hand, DBPro has some options for this...
QuothTheRaven
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 5th Apr 2003 01:38
yup, no easy way to make a mirror. Especially in DB. The simplest way would just be to clone your character and put him on the other side of an empty frame, have him mimick the actions of your character, and boom, pseudo-realistic mirror

Darken the skies, we are god
http://www.DelvarWorld.com
Hell IVIonkey
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 5th Apr 2003 03:08
Problem is that this only works with actual mirrors, not random reflective objects.
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 5th Apr 2003 06:32
i made a camera snippet a short while ago.

it has a reflective video feedback

basically place a new camera in front of a plain and update the plain with the 2nd cameras output.

indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 5th Apr 2003 10:21
oops u will need another method for DBC and that would involve moving the camera really fast to the spot taking a snap then texturing the object.

but it may present slow downs if u want real time updates.

Hell IVIonkey
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 5th Apr 2003 10:25
If the object is just shiny and not fully reflective, you can simulate it by taking a 360 panorama shot of the surroundings and make it a texture. Then, depending on the angle, you can scroll that texture accordingly. Don't ask me about the math behind this.
Dave J
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 5th Apr 2003 15:23
Rob Moran created a mirror demo in DBC where you could move a Pepsi can around and the reflection would update in the mirror perfectly. I believe it was done the same way as QuothTheRaven said, here's the code:



You'll have to use your own files though unless you can find the download somewhere else (not sure if it's on the showcase page). I think it comes with DBC though.

"Computers are useless they can only give you answers."

Login to post a reply

Server time is: 2026-06-11 16:41:30
Your offset time is: 2026-06-11 16:41:30