Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

12046 Posts in 1593 Topics- by 595 Members - Latest Member: KeelmHaxabefe

23. May 2013, 06:44:37 am
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Quake avatar
Pages: [1]
Print
Author Topic: Quake avatar  (Read 1057 times)
maguila007
Enjoying the stay
*
Offline Offline

Posts: 43



View Profile Email
« on: 03. December 2007, 12:03:59 am »

Hi

I need to show two hands with a weapon as Avatar, like Quake.
I tried the DefaultAvatarTransform but It seems it's not what I'am looking for.
Has somebody done an AvatarTransform impl like this?
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #1 on: 03. December 2007, 12:33:19 am »

I need to show two hands with a weapon as Avatar, like Quake.
I tried the DefaultAvatarTransform but It seems it's not what I'am looking for.
Has somebody done an AvatarTransform impl like this?

DefaultAvatarTransform should be, what you need. What's the problem with it?

Marvin
Logged
maguila007
Enjoying the stay
*
Offline Offline

Posts: 43



View Profile Email
« Reply #2 on: 03. December 2007, 05:10:13 pm »

How should I configure the AvatarTransform and the FPHandler for a first person hands avatar?

I look at FirstPersonInputHandlerTest but all the settings for the avatar seems to be ok for a third person game.
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #3 on: 03. December 2007, 05:18:11 pm »

How should I configure the AvatarTransform and the FPHandler for a first person hands avatar?

I look at FirstPersonInputHandlerTest but all the settings for the avatar seems to be ok for a third person game.

Simply don't set these settings:
Code:
fpHandler.setThirdPersonOffset( 0f, 0f, 3f );
fpHandler.setMaxThirdPersonDistance( 7f );
fpHandler.setDiscreteThirdPersonStepSize( 0.5f );

They are responsible for the third-person offset.

Marvin
Logged
maguila007
Enjoying the stay
*
Offline Offline

Posts: 43



View Profile Email
« Reply #4 on: 03. December 2007, 05:39:30 pm »

Here are some screenshots of my problem.

I created a cube as an avatar (it will be replace by the hands).
Then I created a DefaultAvatarTransform and set it to the fphandler:

Code:
Cube cube = new Cube(1f);
this.avatar = new DefaultAvatarTransform( cube, 0, 0, -1, getRootBG() );
getFpHandler().addAvatar( avatar );

The avatar has a [0,0,-1] offset so I can see it.

When I turn the camera to the left, the avatar stays to the right.
The same when I move the camera up and down. The avatar seems to go to the opposite direction of the camera.
Look at the screenshots.
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #5 on: 03. December 2007, 10:48:29 pm »

Ah, I think, I see, what you mean. Of course you want the gun (and the hands) to screen fixed where ever you look at. This isn't necessarily the FPIH's job. You could simply create a Foreground Node with CameraMode.VIEW_FIXED and put your hand/weapon in there.

The Nodes in a Foreground Node are always drawn last. And VIEW_FIXED means, that they are always in the same location (optically) relative to the View.

I hope, this helps.

Marvin
Logged
maguila007
Enjoying the stay
*
Offline Offline

Posts: 43



View Profile Email
« Reply #6 on: 04. December 2007, 02:02:11 pm »

Code:
I hope, this helps.

Thanks, that was exactly what I need.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic