createmirror command?

Blitz3D Forums/Blitz3D Beginners Area/createmirror command?

Cubed Inc.(Posted 2011) [#1]
Can someone explain to me how to use the createmirror function? I'm trying to make a "shiny floor" effect and I can't seem to use createmirror right.


Warner(Posted 2011) [#2]
There is an example in the help files:

source:
http://www.blitzbasic.com/b3ddocs/command.php?name=CreateMirror&ref=goto


Cubed Inc.(Posted 2011) [#3]
I read it and I still dont understand:\
I dont get how just putting in the mirror function right in the middle of the code makes it work properly. I tried that and everything turned upsidedown and weird.


Warner(Posted 2011) [#4]
A mirror is just a real basic effect: it doubles geometry, nothing more.
From the moment on you create it, everything else is rendered twice instead of once.

Normal rendering -without mirror- would be called a 'pass'. The mirror adds a second pass.
The rotation and position of the mirror determine where this second pass is rendered at. A mirror itself is not visible. Behind the scenes, it might just be a regular pivot.

Mirror drawbacks:
1. mirror's are infinitive, there is no end to a mirror
2. mirror's don't cut off: mirror images/reflections can stick out of the mirror

Maybe a more stripped down example shows how the mirror works:

If you comment out the line with CreateMirror, it is just a regular scene. With that line added, you see two cones instead of one.
If you experiment by rotating or moving the Mirror, you see it renders this second cone somewhere else.

In the sample in the manual, the mirror effect is made stronger by creating a 'plane' as well (CreatePlane). The plane has an alpha set to 0.5
When a Mirror or a Plane are created, they are located at (0, 0, 0) -as everything else- and rotated to face upwards: rotation=(0,0,0).

Last edited 2011