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 / Water Reflection (In theorie)

Author
Message
Essence
22
Years of Service
User Offline
Joined: 12th Oct 2002
Location: The Netherlands
Posted: 28th Nov 2004 23:11
Hello folks!

Today, when i took a piss, i was thinking how to make a reflected water surface with a matrix or plain object.

The fastest option is a plain object as far as i know.

Theoretical the surface can be generated like this.

You are a at position 0,0,-20
The water is at position 0,0,0
and above the water is a floating box at position 0,10,0

When you aim the camera at the water (plain) object, the camera moves to the plain with the x-angle of the old position but then + 180+90 degrees more. so you get a sort of bounce-off effect.
create an image from that point and paste it on the water surface.
then restore the old camera position and angle.

The main problem is.. How in gods name should i create something like this?

This is my code so far, only it doesnt create an image with the camera thats been placed on the water surface, NO its making images of the normal camera. and that sux.
create bitmap and stuff doesnt work. the water surface is getting black and oh well.. the screen is flickering like it was insane.

Here's my code:

oh and btw.. dont mind the ENGINE.DBA file, in this its only used for the CAMERA CONTROL.WSAD function.
you can replace that with a normal mouselook/arrow control if you like.

dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 29th Nov 2004 00:09
well if your just having a flat floor then the simplest way is to duplicate everything above the plain and mirror it under the ghosted floor, thus creating the effect of the floor reflecting light.


Essence
22
Years of Service
User Offline
Joined: 12th Oct 2002
Location: The Netherlands
Posted: 29th Nov 2004 02:20
to duplicate everything
you know thats a whole landscape with grass and trees.

there must be an easier way.
Osiris
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 29th Nov 2004 03:04
you didnt really have to tell us this did you

Quote: "Today, when i took a piss"


"The object of war is not to die for your country but to make the other bastard
die for his."
- General George S. Patton
Eric T
22
Years of Service
User Offline
Joined: 7th Apr 2003
Location: My location is where I am at this time.
Posted: 29th Nov 2004 03:06
Well when else do you get ideas about reflected water?

Great ideas come to people in the bathroom, I tell ya.

You know who I pray to? Joe Pesci. He looks like a guy who can get things done. Joe Pesci doesn't **** around. In fact, Joe Pesci came through on a couple of things that god was having trouble with.
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 3rd Dec 2004 23:48
So very very true!
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 4th Dec 2004 00:08
Quote: "Great ideas come to people in the bathroom, I tell ya."


I agree

need help with programming?
Add me to your msn
robo cat
21
Years of Service
User Offline
Joined: 23rd Feb 2004
Location: In a cat litter tray, near you...
Posted: 4th Dec 2004 00:37
I've tried a similar method with a second camera drawing to the image but I didn't find it worked. The cameras fov means that when the 2nd camera is on the water's surface it doesn't get the same fov as if it were a proper reflection. The attached image shows this.

Simple... yet fun!

Attachments

Login to view attachments
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 5th Dec 2004 05:32
he use dbc..

need help with programming?
Add me to your msn

Login to post a reply

Server time is: 2025-05-25 04:18:01
Your offset time is: 2025-05-25 04:18:01