Import 3D floors/slpes as 3D models (Actors)

Handy guides on how to do things, written by users for users.

Moderators: GZDoom Developers, Raze Developers

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
zdusr
Posts: 32
Joined: Fri Mar 19, 2021 12:33 pm

Import 3D floors/slpes as 3D models (Actors)

Post by zdusr »

Hi!

Since I struggled to find short and easy tutorial on how to import 3D models as actors into gzdoom I decided to write one myself.

In Ultimate Doom Builder you can export 3D floors as 3D models. This means that you can also import these 3D models as actors. This means that you can place them as things which is convenient. This also means that you can now have transparent slopes in gzdoom because while slopes cannot be transparent due to gzdoom engine limitations, 3D models from the other can however keep in mind that they dont clip actors movement like real 3D floors do unless you fill them with invisible 3D floors (texture missing from all sides/floor/ceiling). In this tutorial I already assume that you know basics about gzdoom.

Steps:
1) Create 3D floor



2) Draw sector around it and select your 3D floor together with surrounding sector.


3) File > Export > Selection to Wavefront .obj...
3.1) Give your actor name. In this tutorial I name it MyActor.
3.2) Under skip textures add all textures that you do not want to be part of your model. By default UDB includes floor and ceiling textures from containing sector with your model. However you may not desire this.


4) In root directory of your pk3 create file zscript.txt and add the following code:

Code: Select all

#include "zscript/MyActor.zs"
5) In root directory of your pk3 create file mapinfo.txt and add the following code:

Code: Select all

DoomEdNums
{
15000 = MyActor
}
15000 is just random number, it can be anything, it just has to be something because UDB needs it.

So your directory structure should look like this:


6) Edit > Map Options
6.1) Add directory where your object is as resource
6.2) Add gzdoom.pk3 as resource


7) Now place the model as thing (note that you can now play around with roll, pitch and angle.):


8) [optional] mark actor as translucent to get your magical translucent 3D Floor/slope. (NB! Current version of UDB may render it incorrectly if it is translucent so check it in game to see how it looks)


9) [optional] add invisible 3D floor/slope to make this model appear as solid:
This 3D floor is not rendered in game but you can still stand on it. Alternative would be to mark actor as solid but gzdoom engine is limited to square shape boundingbox. With 3D floors/slopes you can follow your model exact if you wish although it would be only useful for translucent slopes.
Guest

Re: Import 3D floors/slpes as 3D models (Actors)

Post by Guest »

It also works for regular, sector constructs. However, they don't have a back side, so they look weird when you turn them on their side and walk around them.
[IMG]https://imgur.com/a/C4y5v85{/IMG]
Fragger
Posts: 41
Joined: Sat Mar 19, 2022 11:59 am
Graphics Processor: Intel (Modern GZDoom)

Re: Import 3D floors/slpes as 3D models (Actors)

Post by Fragger »

You can even create functional 3d monitors if you use a camera texture as the screen.
Guest

Re: Import 3D floors/slpes as 3D models (Actors)

Post by Guest »

Fragger
Posts: 41
Joined: Sat Mar 19, 2022 11:59 am
Graphics Processor: Intel (Modern GZDoom)

Re: Import 3D floors/slpes as 3D models (Actors)

Post by Fragger »

[youtube]https://youtu.be/EgStFvDsNBQ[/youtube]You can even create animated, interactive models

Return to “Tutorials”