Visitar URL original
CityGenerator/blend at master · universalbit-dev/CityGenerator · GitHub
Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

readme.md

Wavefront OBJ File Format Overview

Wavefront OBJ files are plain-text files containing geometric data about 3D objects. They are widely used for transferring models between 3D design and rendering software.


Structure of city.obj

The city.obj file from your repository contains the following key sections:

  1. File Header

    • Example:
      # Blender 4.0.2
      # www.blender.org
      mtllib city.mtl
      o blocks
      
    • Explanation:
      • Lines starting with # are comments, often providing metadata about the file, such as the software used to create the model (e.g., Blender 4.0.2).
      • mtllib city.mtl specifies an external material library (city.mtl) that defines how the surfaces of the 3D model will appear (e.g., color, texture, shininess).
      • o blocks indicates the name of the object being defined in this section.
  2. Vertex Data

    • Example:
      v 18.261637 0.000000 -8.146533
      v 18.662390 0.000000 -8.648925
      
    • Explanation:
      • Lines starting with v define vertices, which are points in 3D space.
      • Each vertex is defined by three numbers representing its X, Y, and Z coordinates.
      • In this case:
        • The first vertex is located at (18.261637, 0.000000, -8.146533).
        • The second vertex is at (18.662390, 0.000000, -8.648925).
  3. Vertex Normals (Optional)

    • Example:
      vn 0.0 1.0 0.0
      
    • Explanation:
      • Lines starting with vn define vertex normals, which are vectors perpendicular to the surface at a vertex.
      • These are used for lighting calculations in rendering.
  4. Texture Coordinates (Optional)

    • Example:
      vt 0.5 0.5
      
    • Explanation:
      • Lines starting with vt define texture coordinates, used to map a 2D texture onto the 3D surface.
      • Each texture coordinate is defined by two numbers representing the U and V axes.
  5. Face Definitions

    • Example:
      f 1 2 3
      f 4 5 6
      
    • Explanation:
      • Lines starting with f define faces, which are polygons that make up the surface of the object.
      • Each face is defined by a list of vertex indices (e.g., 1, 2, 3), referring to previously defined vertices.
      • In this example:
        • The first face is made up of vertices 1, 2, and 3.
        • The second face uses vertices 4, 5, and 6.
  6. Groups and Object Names

    • Example:
      g group_name
      
    • Explanation:
      • Lines starting with g indicate groupings of faces, allowing for logical segmentation of the model (e.g., separating different parts of a building).
      • Groups can be useful for applying different materials or transformations to specific parts of the model.
  7. Use of Materials

    • Example:
      usemtl material_name
      
    • Explanation:
      • Lines starting with usemtl specify which material (from the material library) should be applied to subsequent faces.

Purpose of city.obj

The purpose of this file is to define the geometry of a 3D object (likely a city layout or structure) for use in:

  • 3D Rendering:
    • The file can be imported into 3D rendering engines like Blender, Unity, or Unreal Engine to visualize and manipulate the model.
  • City Simulation:
    • As part of the CityGenerator project, this file might represent blocks, buildings, or other structural elements of a city being generated or simulated.
  • Collaborative Design:
    • OBJ files are commonly used for sharing 3D models between team members or across different software platforms.