Hello everybody,
I'm basically trying to wrap my head around how to make 3D weapon models for GZDoom. I've imported my own 3D models in the past, but they were static models so it was quite easy to do (relatively speaking).
I am however thinking of stepping it up a bit, which means trying to make animated weapons and other models. To start off, I'm trying to figure out 3D weapon HUD models.
The thing that I fail to understand is how the angle and rotation of the model works. For example: when dealing with a sprite weapon, it obviously shows up as an image on the screen on the given coordinates, but how does that work in relation to a 3D model? If I make a model inside a modeling program like Blender, and I use a camera to mimic the first person view, how can I make sure that I get the same result in GZDoom? I've tried looking at PK3 files of projects that use 3D weapons in SLADE, but I could never really decypher things.
I know this is a bit of a longwinded question, but there's still relatively little tutorial resources on 3D stuff, so I'm trying to get educated!
Thank you.
Centering first person HUD models
Moderators: GZDoom Developers, Raze Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
-
- Posts: 1562
- Joined: Tue Oct 20, 2015 12:50 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Kozolupy, Bohemia
Re: Centering first person HUD models
Well, the centrem of rotation and pitch for a model is the model's 0 coordinate. When mapping in <any modelling program>, try to keep the model in the center of the grid. Then, the 0 coordinate of the grid is the centre of rotation&pitch.
When I model in blender, I just try to keep the model in the center, with the handle kept in the very center (0).
As far as I understand when modelling.
Sorry to sound weird, but english is not my native language and explaining these modelling this is little bit hard for me. Hell, it would sound weird even in my native language either.
When I model in blender, I just try to keep the model in the center, with the handle kept in the very center (0).
As far as I understand when modelling.
Sorry to sound weird, but english is not my native language and explaining these modelling this is little bit hard for me. Hell, it would sound weird even in my native language either.
-
- Posts: 265
- Joined: Wed Mar 28, 2012 2:27 am
Re: Centering first person HUD models
I wish there was a way to visualize this for me...ramon.dexter wrote:Well, the centrem of rotation and pitch for a model is the model's 0 coordinate. When mapping in <any modelling program>, try to keep the model in the center of the grid. Then, the 0 coordinate of the grid is the centre of rotation&pitch.
When I model in blender, I just try to keep the model in the center, with the handle kept in the very center (0).
As far as I understand when modelling.
Sorry to sound weird, but english is not my native language and explaining these modelling this is little bit hard for me. Hell, it would sound weird even in my native language either.
If the viewport model is kept at the absolute center, GZDoom will display it properly? How do I know that the player's camera will view the weapon correctly?
-
- Posts: 1562
- Joined: Tue Oct 20, 2015 12:50 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Kozolupy, Bohemia
Re: Centering first person HUD models
Oh you meant to position it properly in the viewport?
Well, the positioning in the viewport is achieved by defining offsets for the said model in MODELDEF lump. Check it: https://zdoom.org/wiki/MODELDEF
Also, you can check my latest release here:viewtopic.php?f=19&t=59461
Grab it, open the modelpack and check the modeldef file for weapons.
Basically, you have to set the model offsets to position it properly.
Well, the positioning in the viewport is achieved by defining offsets for the said model in MODELDEF lump. Check it: https://zdoom.org/wiki/MODELDEF
Also, you can check my latest release here:viewtopic.php?f=19&t=59461
Grab it, open the modelpack and check the modeldef file for weapons.
Basically, you have to set the model offsets to position it properly.
-
- Posts: 265
- Joined: Wed Mar 28, 2012 2:27 am
Re: Centering first person HUD models
Thank you, I will take a look at that.ramon.dexter wrote:Oh you meant to position it properly in the viewport?
Well, the positioning in the viewport is achieved by defining offsets for the said model in MODELDEF lump. Check it: https://zdoom.org/wiki/MODELDEF
Also, you can check my latest release here:viewtopic.php?f=19&t=59461
Grab it, open the modelpack and check the modeldef file for weapons.
Basically, you have to set the model offsets to position it properly.
Are there any tutorials that cover 3D weapons in GZDoom, I wonder? I found one or two before but they only covered static objects.
-
- Posts: 1321
- Joined: Tue Dec 06, 2016 11:25 am
Re: Centering first person HUD models
From the top of my head, there are only three things you must know about using 3D weapon models (other than waht you already know about models in general):
1. They have to have a negative X scale, because they are mirrored for some reason.
2. Overlays from CustomInventories work a bit different: The MODELDEF entry name must be the weapon actor to use it with, but everything else in the entry is as usual.
3. A_OverlayOffset doesn't work like with sprites, it's pretty much useless.
1. They have to have a negative X scale, because they are mirrored for some reason.
2. Overlays from CustomInventories work a bit different: The MODELDEF entry name must be the weapon actor to use it with, but everything else in the entry is as usual.
3. A_OverlayOffset doesn't work like with sprites, it's pretty much useless.