Skip to content

Commit

Permalink
add documentation for room generation and databse generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-LucM committed Jul 16, 2024
1 parent 0d963aa commit 1f33d00
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 3 deletions.
Binary file added src/Assets/ISGT_diagramme.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 36 additions & 1 deletion src/Doc/Steps/db.md
Original file line number Diff line number Diff line change
@@ -1 +1,36 @@
# Database
# Database Generation
## Save Camera view

In the runtime, the main camera view will be automatically saved in the path you specify. The camera view will be saved as a .png file with the date and time as the file name.
There is a parameter where you can set the number of screenshots you want to save per room. The default value is 5.

## Camera parameters

The camera can be adjusted with the following parameters:

- **Field of view**: The field of view of the camera. The default value is 90.
- **ISO**: The ISO of the camera.
- **Focus distance**: The shutter speed of the camera.
- **Aperture**: The aperture of the camera. The default value is 5.6.

- **Camera rotation**: Define the maximum rotation of the camera in degrees. By default, the camera will on all axes.

## Take a screenshot

To take a screenshot of the camera view, you can use the following code:

```Csharp
using UnityEngine;
using CameraScreenshot;

public class CameraScreenshotExample : MonoBehaviour
{
[SerializeField] private CameraScreenshot cameraScreenshot;
void Start()
{
cameraScreenshot.savePath = Application.dataPath + "/yourPath";
cameraScreenshot.CaptureScreenshot();
}
}
```

34 changes: 33 additions & 1 deletion src/Doc/Steps/room.md
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
# Room generation
# Room generation

## Room generation
The room generation is the first step of the generation process. It is the step where the room structure is created. The room is composed of a grid of cells. Each cell has 4 walls (North, East, South, West), a floor and ceiling. The algorithm starts by creating a grid of cells. It then chooses a random cell as the current cell and marks it as visited. The algorithm then chooses a random unvisited neighbor of the current cell and moves to it. The algorithm repeats this process until it reaches a cell that has no unvisited neighbors. When this happens, the algorithm backtracks to the previous cell and repeats the process until all cells have been visited. The result is an empty room with walls, floor and ceiling.

## Room generation parameters
The room generation algorithm has several parameters that can be adjusted to change the room structure. The parameters are as follows:

- **Width**: The width of the room in cells. default value is 2.5 meters.
- **Height**: The height of the room in cells. default value is 2.5 meters.
- **Max room size**: The maximum size of the room in cells. default value is room 40x40 cells.

## Room generation example
The following example shows how to generate a room with the default parameters:

```Csharp
using ClassicRoom;
using UnityEngine;

public class RoomGenerationExample : MonoBehaviour
{

[SerializeField] private RoomGenerationData roomGenerationData;
void Start()
{
ClassicRoom room = gameObject.AddComponent<ClassicRoom>();

room.InitRoom(roomGenerationData);//generate room with defined parameters
}
}
```


11 changes: 10 additions & 1 deletion src/Doc/Steps/steps_menu.md
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
# Steps
# Steps

There 3 big steps to generate synthetic data with `ISGT`:
![](../../Assets/ISGT_diagramme.jpg)

Find details in the following sections:

1. [Room generation](room.md)
2. [Object generation](props.md)
3. [Data generation](db.md)

0 comments on commit 1f33d00

Please sign in to comment.