The Open Plant Scene (ops) format

4.1.2011 - sg, jd, fc: This is an attempt to define a standard format for a scene containing plants (originaly opf files)
21.1.2011 - sg, fc: opfs -> ops, generalization to (i) other files than opf ; (ii) scenarios and projects saving (scene is static OR along time)
24.1.2011 - sg, fc: ops contains ONLY references to opf files.

A need for a scene standard format

Xplo works at the individual plant level on ArchiTrees (in memory) and generates opf files as a standard. These files contain the plant topology AND geometry. Each node of the plant may carry any attributes.

Simeo works on vegetation scenes. It can be used to build scenes interactively and tends to handle the opf files from Xplo as a standard. This document proposes a standard format for a scene made of opf files, to set their locations and possible scales and rotations.

The format is extended to temporal scenarios (scenes at several dates) and projects (several scenarios). The ops file format may become a standard exchange format between Xplo and Simeo. It may also become a standard for communication with other tools.

The ops scene format

The ops scene format is a file with an extension .ops. This file has the following format (to be completed if needed)

# Part 1: one line per plant in the scene
sceneId plantId plantFileName x y z scale inclinationAzimuth inclinationAngle stemTwist

# Part 2 (optional), chaining: only if scenario or project, one line per sceneId in part1
motherId sceneId date
  • the directory containing this scene file is called the scene directory
  • lines beginning with a # are comments (ignored at reading time)
  • all angles are in degrees and counterclockwise (trigonometric sense, trigonometric circle)
  • columns are separated by tabs

Part 1

  • sceneId (int): a unique identifier for the scene in the file. If the file contains one single scene (all plant lines with same sceneId and no chaining lines), the sceneId is the date of the scene.
  • plantId (int): a unique identifier for the plant in the scene.
  • plantFileName (String): the name of the plant file (.opf). This name is a path relative to the scene directory. The plant files may be directly in the scene directory (e.g. plantFileName: eucalyptus.opf) or in a subdirectory (e.g. plantFileName: plants/eucalyptus.opf)
  • x, y, z (double): coordinates of the plants on the scene (no unit, depends on the scene, generally meters)
  • scale (double, strictly greater than 0): scale to be applied to the plant. The value 1 means do not scale
  • inclinationAzimuth, inclinationAngle (double, degrees): to incline the plant: (1) consider the azimuth arround the vertical axis and (2) incline the vertical axis arround the x axis
  • stemTwist (double, degrees): after the inclination, rotate the plant of this angle arround its stem (aka trunk or main axis)

NOTE for opf files: scale, inclinationAzimuth, inclinationAngle and stemTwist are applied only on the opf geometry. The attributes of the opf are not changed (sg, fc, 20.1.2011)

  • it is part of the standard that additional columns may be added after these standard columns for specific purposes, they will be ignored by the standard tools


The plant rotations

[TODO] discuss additional lines for the scene size (i.e. bounding box) and an optional terrain external description (in an obj file ?) and possibly other external objects in obj files ?

Part 2 (optional)

This part concerns the chaining of the scenes. These lines may be omitted in the following cases:

  • if the file contains only one scene (one single sceneId)
  • if the file contains only a simple scenarios, the chaining records will be rebuilt automatically by the OPSLoader. The sceneIds will be considered as dates and sorted in natural ordering.

For more complex projects with many scenarios, this simple format makes it possible to save the project to an ops.

  • motherId (int): the id of the previous scene, convention: -1 for first scene (no father)
  • sceneId (int): the id of the scene
  • date (int): the date of this scene

Rendering ops scenes through obj

The obj format is a widely used standard in visualisation. The opf files can already be turned into obj files (S. Griffon) for representation in existing tools (JMonkey library, blender...).

It would be nice to have an ops2obj program to tranform an ops scene (see upper) into a single obj file for standard rendering.

[NOTE] what about time ? -> one obj file per date ?

Usable in 2 modes:
  • Such a tool should be able to read an ops scene (files) to be flexible: such a scene can easily be written by hand for a specific case.
  • It should also be callable directly in java, giving it the ArchiTrees and additional information related to the terrain and external objects to save time (no opf files written) when trigerred by a sister application (e.g. Simeo -> obj scene -> JMonkey viewer).

Upgrading lig files (and additional files) into single opf files

It would be interesting to have a lig2opf tool to transform the legacy AMAP lig files with all their related files (smb, dta, brc, arc...) into single standard opf files. These files would be simpler to use in the new Jeeb framework and will be possibly added in opf scenes.

scene_opfs_rotations.jpg (19.7 KB) François de Coligny, 01/04/2011 12:43 PM