Traditional Culture Encyclopedia - Photography and portraiture - Reference example of three-dimensional panoramic image modeling

Reference example of three-dimensional panoramic image modeling

The principle of 3D modeling with 3D panoramic images (24 photos) is: according to the original photos, program the pictures with programming commands, and then play the programmed pictures in sequence with Papervision3D software to achieve a visual 3D effect.

Before modeling, you must prepare a computer with Papervision3D and programming software, and you also need a skilled programmer. Panoramic images (24 photos) of each rock specimen were collected.

image processing

1) First, open Photoshop software, import photos of models, select Execute menu-Select-Color Range, and adjust color difference in the pop-up dialog box. The main purpose is to evenly distribute the brightness of photos under the lighting effect.

2) Use the pen tool to selectively key the photo, remove other parts except the model, and then save the completed picture as a jpg file, and all jpg files of each model are saved together.

4.2.3.2 3 d modeling

1) When using Papervision3D imaging modeling, at least four elements should be initialized: window, scene, camera and renderer. ① Window: The window viewed by the user can be simply understood as the canvas size in Flash, and the window can also be understood as the rendering size, otherwise the screen will be infinite. ② Scene: The scene refers to the whole 3D scene. 3 camera: Many people ask, why do you need a window when you have a camera? The camera is used to take pictures and the window is used to look at pictures. The picture taken by the camera will not be completely displayed in the window, and the size of the picture you see depends on the size of the window. ④ Renderer: Its function is to turn all input data into images.

2) create a new actionscript file, save it as test0 1.as file, and write the following code:

Bag {

Common class test0 1 extended sprite {

Common function test0 1():void {

}

}

}

. As stands for the suffix of the class structure file, test0 1 is the system configuration file of the software itself, and all PV3D must inherit the sprite class. After the document is established, the document format will guide the automatic search for system files and modify the software configuration.

private var viewport:viewport 3d = new viewport 3d(400,00); //Initialize the window

Private var scenario: Scenario 3D = a new scenario 3D; //Initialize the scene

Private var camera: camera 3D = new camera 3D; //Initialize the camera

Private var renderer: basicrendrengine = new basicrendrengine; //Initialize the renderer

Through the above steps, four elements are initialized.

Addchild(viewport)// window

Renderer.renderscene (scene, camera, viewport); //Render the picture

Addeventlistener (event, ENTER_FRAME, process); //Render pictures. You can render 30 pictures at a time.

3) Put 24 model photos into it to apply, and separate them in/* format ... */when programming (Figure 4. 102).

Yes, we must import the following classes:

Import flash.display.sprite;

Import flash.events.event;

Import org.papervision3d.cameras.freecamer3d;

Import org.papervision3d.render.basicrendrengine;

Import org.papervision3d.scenes.scene3d;

Import org.papervision3d.view.viewport3d;

Fig. 4. 102 geological specimen photo group.

Import org.papervision3d.materials.bitmap filematerial;

Import org.papervision3d.materials.utils.materials list;

Import org.papervision3d.objects.primitives.sphere;

4) After executing the program, you can see the three-dimensional rock specimen model.

5) Save the 3D model, open it in web browsing, and then rotate to watch the model effect (Figure 4. 103).

Figure 4. 103 3D modeling of rock specimen model