Sentence. 2D image in 3D


#1

Add the function of opening images 2D extensions to PNG, BMP … as 3D objects, but with a very thin thickness. HTTPS://Castle-Engine.IO/manual_load_3d.php here I can only download 3D model, and I would like to 2D model with the extension. PNG
image

As well as for my project is very necessary.


#2

ildus03, hi!

You cannot add an image directly to 3D world, as the image must be “rendered onto something” to be visible. 2D image is a “texture” and 3D object is a “shape/mesh” - those are two inherently different objects. You can mix 3D and 2D objects by creating a 3D Quad (this is exactly a “very thin thickness” shape).

Check this example: https://github.com/castle-engine/castle-engine/blob/master/examples/3d_rendering_processing/render_3d_to_texture_and_use_as_quad.lpr#L116. The only difference will be that you would need to load the image, not to render it from an existing 3D object.


#3

As a demo, I implemented it :slight_smile: See the example code on https://castle-engine.io/x3d_implementation_geometry3d.php in the section Example in Pascal (build a textured rectangle) .

This loads an image as a rectangle into TCastleScene.


#4

Many thanks! You really helped!