Game Development Community

First Person Weapon Model?

by XoCluTch · in Torque Game Engine · 08/18/2002 (10:17 am) · 128 replies

Hey,
I am trying to make a change to the engine so when the player is in First Person model of the weapon he see's will differ from the weapon he see's in Third Person or to anyone else looking at him.

Does anyone know how i can perform a engine change like this? I'm pretty good at coding changes to the engine. But this might be a little over my head =P

Any help is Welcome..


Thanks,
XoCluTch
#41
07/17/2004 (8:14 am)
Tried calling the animate method on the appropriate TSShapeInstances?
#42
07/27/2004 (7:15 am)
Ok I have struggled with this for quite a while now, and I have managed to, just a couple of days ago when I went back, the get the ejectNode to be correct depending on what view and such.

I am really have trouble trying to get this to animate both of them, I wonder if there is a way to have 2 seperate datablocks, so when your in first person your using one and when your in third your using another... I guess that would open up for features and keep it easier to read... Or even better, just change it so the itemData model is shown in third person(no animation just model, but with like ejectpoint and muzzle) and have the datablock model show in first, just a thought I will continue pondering and coding.

Anyway, I would like some help, thanx!
#43
07/28/2004 (3:59 am)
I hate doing this*bump*
#44
08/11/2004 (4:32 pm)
Looking into it. :)
#45
08/17/2004 (4:20 am)
Hows it going?
#46
08/17/2004 (5:28 am)
Not good
#47
08/18/2004 (11:29 am)
Hmmm, I was wondering, does your 3rd person model need to animate?

Because wouldn't it be easier to create like a static model(a model which does have to animate) inside the shapeimage class and then display that as the 3rd person model mounted where it needs to be and use what is already there to animate your first person model... I wouldn't know how to do this so if anyone knows how to it would be great, I know my 3rd person models doesn't need to animate because I tell my player model to animate for things like kickback and such.

Anyway, if anyone would know how to code this it would be great, I have looked into it and it just leaves me scratching my head because I haven't got my head around the 3d C++ coding of the engine yet.

-Banshee
#48
08/27/2004 (2:18 am)
Ime interested a lot in this topic. worldView and playerView weapons would enlarge the torque's genuinity. getting to render arms and better anims (as stated above) would be such great addition..

so is anyone up with this yet? ime giving him a weapon (animated, lol) if so. :)
Ime serious, being a modeller and a crappy programmer, barter is a solution sometimes.
#49
03/07/2005 (2:29 am)
This is a very need to add function to torque. The 'floating' weapons without
hands are stupid and out of time. Hope someone will have a working solution
for this prob.
#50
03/11/2005 (8:49 am)
I'm looking for a solution to this as well. I hope somebody has some info about it...
#51
03/11/2005 (10:09 am)
Probably won't see a solution, I'm afraid. It has been up for very long and 2 years ago, Joe Maruschak said they discussed it with GG. If it haven't gotten in yet, then it probably won't either.
#52
03/16/2005 (10:17 pm)
Did you guys look into this at all?

It doesn't solve the two models problem, but it does allow you to see your arms like someone mentioned.

In player.cc in the Player::renderImage() function, if you set renderPlayer to always be true like this.
if (!sRenderMyPlayer)
         renderPlayer = false;
      if (!sRenderMyItems)
         renderMounts = false;
	  renderPlayer = true;

Then the player will be rendered in first person view too. So you will see his arms holding his weapon (and his legs). Plus you'll see the shadow. Hope it helps

netfiles.uiuc.edu/bjsmith4/shared/first_person.jpg
#53
03/16/2005 (10:24 pm)
I'm afraid that has nothing to do with seperating the models though, Brandon.
#54
03/17/2005 (5:38 am)
No it doesn't sorry,

It was kind of a response to Micheal Schaumberg's problem where he said that didn't like how all the weapons were floating and you couldn't see the characters hands. I had that problem too. Sorry again it was so off topic.
#55
06/16/2005 (6:30 pm)
I'm working on this problem too since some time and haven't found a good solution yet.

Please - if there is anyone out who knows how to do it - create a resource.
#56
08/01/2005 (10:56 am)
I recently did a little work with this, but wasn't to make a seperate model. I couldn't work that out and I needed the seperate model so I would have hands on the gun and reload animations, etc.
Bradon's fix there can actually be done through renderFirstPerson in the datablock in script, although this still leaves the arms still and unmoving in most animations and still looks odd i think.

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8397

That there gives you first person rendering, full first person animation, and camera movements with the player. This is the best I can do for now., maybe this will help with what some of you needed.
#57
08/01/2005 (11:22 am)
Great fix Jacob.

I'll be looking into seperating the images later this week.
Been trying to use what Westy wrote up there, but I really can't see how it would make a difference and render two different shapes.

What Westy was doing was to create two images instead of one, each different for both views. They were created this way:
image.shapeInstance = new TSShapeInstance(image.dataBlock->fpshape, isClientObject());

As far as I know, this means they won't be linked to the sequences, and thus won't animate like you expect them to.
That's why suddenly both the 1stperson image AND the 3rdperson image stop animating.

I was going to look into how weapon images were created normally (as default TGE does not use the above mentioned function to create the weapon images, AFAIK) but I couldn't find it. I also tried to find a way to animate sequences on the TSShapes created, but that was ugly and not synched at all.
#58
11/05/2005 (3:58 pm)
2 month bump. Any progress?
#59
11/06/2005 (8:37 pm)
I don't think so, I spoke to Westy the other day and its doubtful he will be working on it.

But I'll be working on it, with maybe a few extra pointers from Westy, so if I make any progress, I'll keep this thread updated


Chris
#60
11/06/2005 (10:46 pm)
There is another simple approach. The shape already holds multiple models in the form of LODs so just make you highest detail mesh be the 1st person mesh.

With the camera being that close to the object, it should already be rendering at its highest detail level without the need to change any code, but you can force it if in doubt. i.e. make a HIGH detail mesh and set it's LOD size to 1000 which will pretty much ensure that the screen-size based LOD algorythm never renders it, so to see it, you will have to force it to that detail level.

Fortunately, the render function takes a parameter for the detail level and you can make some code changes to force it to the highest detail level when in 1st person mode and only when rendering your own player plus mounts.