Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Mirror effect for the Actor  (Read 4604 times)

0 Members and 1 Guest are viewing this topic.

Derrek3D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 82
    • View Profile
Mirror effect for the Actor
« on: September 04, 2007, 04:24:53 PM »

Hello,

I'm trying to implement a room, in which a large mirror should reflect the Actor (a 3D actor) when he stands in the mirrors general vicinity. How would I go about creating the reflection? I went through the various threads dealing with reflections but I haven't found any complete answer to this situation.

I think I will go for the separate actor scheme (with semi-transparent textures) but I'm still unsure as to how to place the second actor (the "reflection") on screen and how to control its actions. I mean, it should completely mimic the real actor (in a mirrored sort of way) including all engine-controlled animations (e.g. walk, idle, etc.).

I'm not looking for actual code here. All I'm after for the time being is ideas as to how to implement this.

Thanks.
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Mirror effect for the Actor
« Reply #1 on: September 04, 2007, 10:25:43 PM »

It's just my night rambling, but what would I do for example with walking would have been overriding GoTo method by your custom.
This method would at the beginning check if the action should be mirrored and if so, you make the mimic thing.

so in actor.script I'd write something like this:

method GoTo(posx, posy)
{
    global isMirorred;
   
    if (isMirorred)
    {
        var newX;
        var newY;
        // perform some recalculation of inverse coordinates in here and fill it in newX, newY.

        actorMirror.GoToAsync(newX,newY);
        actor.GoTo(posx,posy);
    }
    else
        actor.GoTo(posx,posy);
}

It's incomplete, but could give you the idea.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Derrek3D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 82
    • View Profile
Re: Mirror effect for the Actor
« Reply #2 on: September 05, 2007, 09:28:23 AM »

Thank you metamorphium, this is indeed what I had in mind. But the question is whether the next two lines are guaranteed to animate exactly the same (albeit mirrored):

Code: [Select]
actorMirror.GoToAsync(newX,newY);
actor.GoTo(posx,posy);
 

If we forget about the mirror for a second and take a simpler case - loading the same actor twice and placing them one next to the other both facing the camera. One of them is the main Actor and the other is not. Can we make the second actor visually behave exactly the same as the main actor? Will all animations play exactly the same (including idle animations)? I'm asking because I'm not sure we can control each and every frame of the animated 3D actor and I'm not sure perfect visual synchronization between two equal actors is possible.

What do you think?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Mirror effect for the Actor
« Reply #3 on: September 05, 2007, 05:46:38 PM »

I'm asking because I'm not sure we can control each and every frame of the animated 3D actor and I'm not sure perfect visual synchronization between two equal actors is possible.
It's not. I'm afraid there's no perfect way of doing that in WME, there are only workarounds..
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Mirror effect for the Actor
« Reply #4 on: September 05, 2007, 06:22:17 PM »

the question is, if anyone cares if it's 100% perfect. If you stop thinking about the game as of the technology demo and start to think
about it, as of a game with gameplay and all, usually players don't even notice minor imperfections like that.

This being said, once in the future I hope Mnemonic implements surfaces for mirrors for sure. :)
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Nihil

  • Supporter
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 528
  • Fear me! I'm evil!
    • View Profile
    • Order of Dagon
Re: Mirror effect for the Actor
« Reply #5 on: September 05, 2007, 06:50:57 PM »

From a players point of view, and depending how big the mirror and the actor are in the scene, I'd probably just use some pre-rendered sprites instead of dealing with a second 3d actor - at least if the mirror is just eye candy and not a too prominent part of the scene.

Derrek3D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 82
    • View Profile
Re: Mirror effect for the Actor
« Reply #6 on: September 09, 2007, 10:28:34 AM »

Thank you guys!

This being said, once in the future I hope Mnemonic implements surfaces for mirrors for sure. :)
Well, as much as I would have wanted that, I have no idea if Mnemonic is planning on implementing that tomorrow or maybe next year - if at all, so I can't count on that...

I'm afraid there's no perfect way of doing that in WME, there are only workarounds..
Can someone please list the know workarounds along with their advantages and disadvantages?
Logged
 

Page created in 0.045 seconds with 19 queries.