Product Chat / How to add models to the first person camera?

Author
Message
Ravenous
GameGuru TGC Backer
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location: Spain
Posted: 7th Dec 2016 14:13
Hello everybody,

I was wondering if it could be possible to add static models to the camera, in front of it. My idea is to make a cockpit like in the Mechwarrior games, or any flight simulator for example. Instead of simulate it with a flat semitransparent png file, it would be much better if I could model a custom cockpit and then import it into GG and add it in front of the camera so it would move and rotate with the camera. The only trouble I see is how this would interact with the colision system.

Anybody has tried it?

thank you very much!!
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 7th Dec 2016 19:15
Yes you can do this if you switch off the collision of the model being rendered at/around the player position. You then have to get creative if you actually want the collision to work (such as being in a ship or car) - no ideal solution I've found to this yet.


Ravenous
GameGuru TGC Backer
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location: Spain
Posted: 9th Dec 2016 12:01
Thank you cybernescence!

And regardless of the collision system, how I can add/attach a model to the camera?

thanks
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 9th Dec 2016 13:34
You can take a look at the jetpack. It is a 3d hud and follows the camera when pickup or assigned.
It can be found here:
Game Guru\Files\gamecore\hudlayers

There is a script in the scriptbank folder called jetpack I believe.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 9th Dec 2016 14:20 Edited at: 9th Dec 2016 14:21
as a suggestion you could try first backing up the jetpack folder i.e. gamecore/hudlayers and replacing with your own model/textures etc and then add an entity of your 1st person model in the entitybank that you could pickup and edit/attach the jetpac.lua script to that to see if it works. Of course I've not tested it out myself but in theory could work but by no means a long term solution if you want to use the jetpac
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, SQL, PL-SQL, JavaScript, HTML, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: SegAutoWelder, Entity+Weapon Welder
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 9th Dec 2016 16:27
It actually works pretty good. I did a small test interior of a car.
You will want this detailed and all visible mesh normals facing the player for the interior. The use of an _i.dds texture for illumination may be cool also.

You may need to play with the rotation upon export from your model program depending on which axis is y.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Login to post a reply

Server time is: 2024-07-03 06:37:26
Your offset time is: 2024-07-03 06:37:26