Game Development Community

Drawing 3d model to player/Hudd.

by Luke Griffin · in Torque 3D Professional · 04/13/2011 (11:13 am) · 3 replies

Hi all,

I have a very quick question in regards to drawing 3d models on screen. First off I would like to create a gas mask/space helmet feature. When the player has said item equipped, rather then displaying an image of the interior of the mask on the screen I would like to render a physical model over the players view so they can see from inside the mask out. My hope is that this will reflect all the current light and environment and would add to the feel of the effect. I have tried a GuiObjectView in the gui editor and was able to get it to display a model but all the lighting on my level screwed up. I don't think drawing it on the actual gui would be best anyway as I want it to be effected by the levels lighting and fx. It only needs to work in first person view as my current project has third person disabled. Does anyone know how I can approach this problem?

#1
04/13/2011 (11:35 am)
If a player model has it's camera/cameraNode positioned just right you can see your body while looking down/around. The trick is to have it positioned so that your viewpoint doesn't clip through geometry. If you carry that principle a step further it should be possible to be able to look through a mask/helm/etc without doing anything too tricky. Whether or not that would truly allow the simulation of lighting and other fx I don't know - I've personally never ventured past the mask/helm/etc gui overlay image.
#2
04/13/2011 (1:13 pm)
OK I have just tried replacing the player model with my space helmet to test the theory. There are a couple of problems. First one is, I cant seem to get it to line up well, parts of the helmet seem to disappear as I move. This could probubly be solved by making it larger and moving it around a bit. Problem two is that it remains fixed on the X and Y axis but when I look straight down or up it obstructs the view as it doesnt move with me. Problem three is that the equiped weapons pass through the helmet. Final problem, how could I activate this by using a button rather then replacing the player model which makes me as tall as the helmet. "very short"

Any ideas would be much apprechiated.
#3
04/14/2011 (1:00 am)
Also I have been trying to come up with a looping sound to play while the "mask/helmet" is on, for example a breathing sound. I can get the sound to play as a AudioGui, using an SFXProfile and the method

SFXPlayOnce(MaskBreathingSound);

The sound is looping but I cant get it to stop. I've tried

SFXStop(MaskBreathingSound);

but that doesnt work. Any help with this as well would be great.