PDA

View Full Version : Problems creating a mirror


Josh
01-28-2010, 11:34 AM
Hi all

I'm trying to create a mirror. I use the example script from http://kb.worldviz.com/articles/243 but I have problems to adapt it to my needs.

I wanted to use my own world (created in 3DSMax), but the script does horrible things to my world!

If anyone would download the stuff and test it for me and maybe correct it, I would be very happy.

http://rapidshare.com/files/342545625/Mirror.zip

The script has the addMirror() function commented out (the last line in the script); uncomment it to see what happens.

Thank you very much for help, I need this for my bachelor assignment.
Josh

Josh
01-28-2010, 11:49 AM
So far I got it to work using the following code:

mirrorsurface = viz.addTexQuad()
mirrorsurface.scale(.3,.25,.6)
mirrorsurface.setPosition(0,1.8,1.2)
mirrorsurfacerotation = [0,0,0] #rotation around the Z,Y,X axes #changed from [90,0,0]
mirrorsurface.rotate(mirrorsurfacerotation)
m = viz.Matrix()
m.setPosition(mirrorsurface.getPosition(viz.ABS_GL OBAL))
m.setEuler(mirrorsurfacerotation[0]-180,-mirrorsurfacerotation[1], mirrorsurfacerotation[2]) #Z,X,Y
addMirror(mirrorsurface,m)

But I'd like the mirror to be on the red textured block of the world itself... How could I achieve this?

Josh
01-28-2010, 12:21 PM
Hrm, it seems I can't edit or delete my own posts here?

Sad, because I proceeded with my work, solved some problems, and got another one... So I'm just attaching it here in a reply to myself.

Now I figured out how to add the mirror. But at the moment the avatar itself is not being displayed in the mirror! Why not?

http://rapidshare.com/files/342564961/Mirror.zip

Thanks a lot for help
Josh