| Metiphisto |
Your scenario is pretty cut a dry and I will explain how the rules state it.
If you are trying to get a sneak attack a character is allowed a sneak attack when the target is denied its dex bonus.
A surprise round denies dex bonus and also the first round of combat before you act. After you have act you are considered to be involved in combat. A rogue attacking from concealment and has made a hide check opposed by the target if they have the option to notice them is considered hidden for the purpose of denying a dex bonus. Also is the case of cover such as behind a table and the rogue hides. He is hidden as long as he has places to hide for the purpose of cover or concealment. At any point in time he steps out of concealment or cover he is no longer concealed.
Lets take your example. Bob the rogue is fighting with his friends Fred the warrior Joe the sorcerer and Pam the cleric. All of them are fighting a ogre who is really made you made him spill his chili. Fred is "tanking" the creature taunting and hitting it with his metal stick thing (I think we call it a sword). Joe just cast daze on it and Pam is busy casting bless. Bob has been detected in combat since he was the person that made the chili get knocked over. So he runs away to hide behind the table. If you are being observed then you are technically unable to make a hide check unless you have hide in plain sight. Lets assume Fred uses Bluff on the Ogre and you jump behind a table there for granting you enough cover to hide. You have successfully hide from the Ogre. And as long as you remain behind cover (or out of line of sight) you have concealment from the Ogre therefore denying it the bonus if any to its dex. As soon as the rogue steps out from cover and there is not shadows or other things to hide behind you are not granted cover and there fore do not have concealment.
This is because in combat there is no facing and a character or NPC is considered to be constantly looking around his surroundings. So in your example if the rogue was out of LoS (Line of Sight) for whatever reason from the Ogre then yes, but if there Ogre has any form a LoS, then an opposed check is made. Again this assumes you do not have HIPS (Hide in Plain Sight) and also assumes there is not shadowy illumination which is enough to hide in. This is why lighting and objects in a room all come into play when planning out attack scenarios in 3.5 Hope this answers you question.