Class TestBox : Actor {
Default {
//$Category Decoration
Radius 32;
Height 64;
}
States {
Spawn:
EVPL A 1;
Wait;
}
}
.obj definition
Spoiler:
# Blender 3.4.0
# www.blender.org
mtllib test_box.mtl
o Cube
v -32.000000 0.000000 32.000000
v -32.000000 64.000000 32.000000
v -32.000000 0.000000 -32.000000
v -32.000000 64.000000 -32.000000
v 32.000000 0.000000 32.000000
v 32.000000 64.000000 32.000000
v 32.000000 0.000000 -32.000000
v 32.000000 64.000000 -32.000000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -0.0000 -1.0000 -0.0000
vn -0.0000 1.0000 -0.0000
vt 0.515625 0.718750
vt 0.515625 0.625000
vt 0.546875 0.640625
vt 0.484375 0.718750
vt 0.484375 0.625000
vt 0.453125 0.640625
vt 0.515625 0.703125
vt 0.546875 0.671875
vt 0.484375 0.703125
vt 0.453125 0.671875
vt 0.515625 0.640625
vt 0.484375 0.640625
vt 0.515625 0.671875
vt 0.484375 0.671875
s 0
usemtl Mat1
f 1/1/1 2/4/1 4/9/1 3/7/1
f 3/7/2 4/9/2 8/14/2 7/13/2
f 7/13/3 8/14/3 6/12/3 5/11/3
f 5/11/4 6/12/4 2/5/4 1/2/4
f 3/8/5 7/13/5 5/11/5 1/3/5
f 8/14/6 4/10/6 2/6/6 6/12/6
Re: Model appears shorter than expected
Posted: Thu Jul 13, 2023 11:29 am
by GalaxyStranger01
Unless I'm wrong, it looks it's just rendering it as the engine wants. Did you measure out 64 units in your modeling software? If so, I don't think it's gonna line up.
What I do is make a model based on the sprite dimensions - whatever they may be. Then, like the sprites, it renders the model as expected because the difference has already been taken into account. My SIZE may be off, but the dimensions will be correct.
So you can either do that with the box texture and model to it, or change the scale in the definition.
Like I said, I could be wrong, but that's what it looks like to me.
Re: Model appears shorter than expected
Posted: Thu Jul 13, 2023 11:47 am
by 7Soul
GalaxyStranger01 wrote: ↑Thu Jul 13, 2023 11:29 am
Unless I'm wrong, it looks it's just rendering it as the engine wants. Did you measure out 64 units in your modeling software? If so, I don't think it's gonna line up.
The box is 1m³ in Blender, then exported at 32 times the size. The x and y sizes appear correct, taking a 64x64 units space, but the z size is shorter
GalaxyStranger01 wrote: ↑Thu Jul 13, 2023 11:29 am
So you can either do that with the box texture and model to it, or change the scale in the definition.
That can be done, but it would be easier if it just rendered at the same size as I see it in Blender to begin with
Re: Model appears shorter than expected
Posted: Thu Jul 13, 2023 11:53 am
by Xeotroid
The world itself (map geometry and sprites) is rendered stretched by 20% as part of the aspect ratio correction. 3D models aren't affected by this, so they are rendered the same way as you see them in Blender. If you're using models that need to fit level geometry, either account for that when making them, or use Scale 1.0 1.0 1.2 in MODELDEF.
Re: Model appears shorter than expected
Posted: Thu Jul 13, 2023 12:37 pm
by 7Soul
Xeotroid wrote: ↑Thu Jul 13, 2023 11:53 am
The world itself (map geometry and sprites) is rendered stretched by 20% as part of the aspect ratio correction. 3D models aren't affected by this, so they are rendered the same way as you see them in Blender. If you're using models that need to fit level geometry, either account for that when making them, or use Scale 1.0 1.0 1.2 in MODELDEF.
Thank you for the link, I changed the pixelratio to 1 and it was enough to get the models to render properly (only in UDB they still appear shorter)
Re: Model appears shorter than expected
Posted: Thu Jul 13, 2023 1:32 pm
by Xeotroid
In UDB preferences, on the Appearance tab, untick the "Stretched view in visual modes" option, that should fix it. I haven't checked how it works, though, and the tooltip says it stretches the geometry and sprites by 15%, not 20%. I assume that's just an error in the tooltip, as otherwise models that are pre-corrected to the default stretch level would be too tall for me.
Do note that when changing the pixelratio value, it obviously causes things made with the stretching in mind squashed (see examples here), so I personally wouldn't recommend it unless your mod/game has all custom graphics made with regular square pixels in mind. In that case, it makes stuff easier (especially since making pixel art in Photoshop with ARC is a supreme pain in the ass).
Re: Model appears shorter than expected
Posted: Fri Jul 14, 2023 5:39 am
by 7Soul
Xeotroid wrote: ↑Thu Jul 13, 2023 1:32 pm
In UDB preferences, on the Appearance tab, untick the "Stretched view in visual modes" option, that should fix it. I haven't checked how it works, though, and the tooltip says it stretches the geometry and sprites by 15%, not 20%. I assume that's just an error in the tooltip, as otherwise models that are pre-corrected to the default stretch level would be too tall for me.
Do note that when changing the pixelratio value, it obviously causes things made with the stretching in mind squashed (see examples here), so I personally wouldn't recommend it unless your mod/game has all custom graphics made with regular square pixels in mind. In that case, it makes stuff easier (especially since making pixel art in Photoshop with ARC is a supreme pain in the ass).