Pioneering thinking, how to use programming ideas for three-dimensional modeling (1)

Source: Internet
Author: User

First of all, we think that three-dimensional modeling will probably think of the autocad,3dmax of modeling software. For some programmers without a sense of design, it might not be easy to make a design-like three-dimensional building, but would you be interested in trying it if you could do three-dimensional modeling by programming? Let me take you into a programmable three-dimensional world.

1. This software I am going to talk about is called Cityengine, if the cityengine know the great God can drift over, Cityengine was originally from the Swiss Institute of Technology Zurich, Pascal Miller (Pascal Mueller) (Miller was one of procedural's founders and later became CEO of procedural Company) design and development. While Miller was in the computer Vision Lab, he invented a groundbreaking program modeling technique that was used primarily for three-dimensional architectural design. July 2011, ESRI Company President Jack At the ESRI International User Conference in Santiago, Mr. Dangermond announced the acquisition of the Swiss procedural company to tens of thousands of participants, and the product was formally renamed to Esri CityEngine;

2. What would we do if we were to build a three-dimensional building? is not the only? Never mind, let's take a look at how people solve them and draw inspiration from them for their own coding process.

3. Let's start with our explanation:

A. Find a vacant space first

B. Create a new rule, stretch the selected parcel by 30 meters, and name the resulting rectangle building, with the following rules (note "//" as comment content)

Lot refers to the current function of the plots--and  means that the model is about to be replaced
Lot-->

extrude( tensile height ) extrude (h) Building

C. Building decomposition, divided into the roof roof, surrounded by walls wall, to replace the building (for demonstration convenience I add color to them)

building-->//Comp () {} component Split function top side is the function keyword Comp (f) {Top:roof|  Side:wall}roof-->// roof add red color (1, 0,0) Wall-->// Wall Green color (0,1,0)

D. Then the y-axis division of the wall, divided into a level of floor

wall-->//split () Split function about average 3.1 The wall is divided along the y-axis to generate floor split (y) {~3.1:floor}*// above the green vanishing Note this is the Wall to replace  Color (1,0,0)

E. X-axis segmentation of floor tiles for each layer (for Windows generation), Wallside (Wall)

floor-->//dividing the building wall along the X-axis | windows | the loop of the wall split (x) {0.5:wallside| {~2:tile|0.5:wallside}*}

F. Create windows in the center of the tile window, and up and down on both sides of the wall Wallside

tile-->//split along the y-axis split generation up and down for the wall wallside in the Indirect window window split (y) {0.5:wallside|  {~2:window|0.5:wallside}}

G. The general shape of the building has come out, we began to beautify the roof to map first

roof-->//'1) projectuv (0)// picture address texture ("  /esri.lib/assets/roofs/flat/flatroof_10.jpg")

H. We map the walls and windows.

window-->'1) projectuv (0) texture ("1409020150_ 15553.obj/sash_window_7.jpg") wallside--1, 1) projectuv (0) texture ( " /ganzhou/assets/wall_textures/stone/wall_stone_4.jpg ")

So far has been basically built, due to content length limitations, follow-up content I put into pioneering thinking, how to use programming ideas for three-dimensional modeling (2);

Pioneering thinking, how to use programming ideas for three-dimensional modeling (1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.