Hi,
this is about 3rd person cameras, once again. I've read about 200 posts about that issue on this board, but didn't find something solving my problem, so please actually read this before flaming me
I've created several 3rd person cameras for my program, but all of them have some sort of a problem. The flying camera, that follows the player and collides with walls can get stuck and generally doesn't look quite as nice as I want it to - that's why I went back to the other camera solution.
Basically just a manual camera following the player at a certain distance and rotation around him at the users command.
Well, the only problem is, that I don't want it to collide with walls (easy) and want the objects between the camera and the player to disappear (not so easy), which is exactly my problem.
Are there any good ways to do that? I tried using rays with the collision manager and setting intersections to invisible. That doesn't quite do the job, though, as my .bsp map would be completely invisible if some single wall came in between camera and player. And besides that I'd rather have them transparent than invisible.
Is there any way to do that? I.e. find out which objects are between camera and player and make them transparent ?
Thanks for your help,
kmh
making objects in front of camera transparent
-
- Posts: 62
- Joined: Fri Jan 07, 2005 4:37 pm
- Location: California
getSceneNodeFromCameraBB(camera)
I think that you are looking for something like this...
getSceneNodeFromCameraBB(camera);
do a forum search for the above function and you will find
a few examples of similar effects!
I have used this to "light up" NPC's that are close to my model.
getSceneNodeFromCameraBB(camera);
do a forum search for the above function and you will find
a few examples of similar effects!
I have used this to "light up" NPC's that are close to my model.
deprecated, thanks for your reply.
The problem isn't finding the collision (I used getSceneNodeFromCameraBB for that, too), but to restrict the transparent/wireframe look to the bits that are actually in the way.
As I said, I don't want the whole big .bsp map to go transparent, just because I need some wall to disappear.
As in, how can I refine the setMaterialFlag function or the SceneNode to just represent the part intersected? If that's possible at all.
The problem isn't finding the collision (I used getSceneNodeFromCameraBB for that, too), but to restrict the transparent/wireframe look to the bits that are actually in the way.
As I said, I don't want the whole big .bsp map to go transparent, just because I need some wall to disappear.
As in, how can I refine the setMaterialFlag function or the SceneNode to just represent the part intersected? If that's possible at all.
Since you use one mesh for whole scene, you would need to get ray from camera to your character, then get triangles of your level which collide with that ray and then set those triangles semitransparent.
You should look in to the triangleselector. Anyway that gona be quit dificult.
Easier way would be to split your scene in to the seweral objects (for example portions of wall) check ray collision and then set them semitransparent.
You should look in to the triangleselector. Anyway that gona be quit dificult.
Easier way would be to split your scene in to the seweral objects (for example portions of wall) check ray collision and then set them semitransparent.
-
- Posts: 62
- Joined: Fri Jan 07, 2005 4:37 pm
- Location: California
Well, i donno if this would work, but you could find the rectangle(s) that you want transpanent and use "draw2DImage" to change the alpha value and texture (on those particular rectangles, then change it back...
check out....
irr::video::IVideoDriver::draw2DImage
I'd be interested in the outcome, cause I'd like to implement something similar!
check out....
irr::video::IVideoDriver::draw2DImage
I'd be interested in the outcome, cause I'd like to implement something similar!