Hello to all,
are just starting out with TouchDesigner, but I have years of experience with quartz composer programming, openFrameworks, OpenGL.
To familiarize with TD, I would try to create a scene in which the camera travels inside a forest, generated in real time. I took as a reference the performance “into the trees” by Robert Hodgin:
[url]http://vimeo.com/15173752[/url]
[url]http://vimeo.com/14417062[/url]

I know, the scene is quite complex, but I think it is an excellent exercise to begin to understand the logic of TD.
The main parts to be implemented are:
Terrain generation: generate a never-ending terrain.
Camera movements: let the camera follow the terrain height and to orient in the right direction.
Instantiating trees during the trip: Trees have to grow up only when you want them, and only in a little portion of the terrain near the camera (not on the whole terrain).
Godrays: It’s just a matter of shader. I know how to implement this effect in OpenGL, I’ll try a TD transposition when I know how to solve terrain/camera/trees issues.
Particle effects: Same of godrays.

I tried a couple of approaches to the generation of the ground and the camera movements: move the ground and stop the camera, move the camera and stop the ground, displace the ground with a shader. Each of them with a few problems inside. :
Here there are the solutions I tried:

project forestLoop_camMove
forestLoop_CamMove.zip (645 KB)

Terrain generation
The terrain is generated from a grid + noise.
Movement of the camera.
The camera moves in depth and is at a fixed height from the ground. The height is calculated by the intersection of a vertical line that moves together with the camera.
When the camera reaches the end of the land should see a new grid to look like a continuous ground. How to manage the instance of new grid at the exact time? How to make noise between the two grids uniform, to avoid discontinuity?
Instantiating trees during the trip.
Starting from the ground, through carve SOP and facet SOP I selected a subset of the vertices of the land closest to the camera. On these vertices via copy SOP I instantiate the trees.

project forestLoop_cylinder (REQUIRES TD 088)
forestLoop_Cylinder.zip (110 KB)

Terrain generation
The terrain is generated from a cylinder + noise. The cylinder rotates along X axis, while the camera is fixed.
Movement of the room.
In the mesh imported there is also a draft of the path that the camera should follow. To understand the motion of the camera I though to take the points of intersection between a FIXED line that intersects the edges of the path and the ROTATING ground. How can I do that?
Instantiating trees during the trip.
I should be able to always select the portion of the cylinder in front of the camera to instantiate the trees in that portion, but I do not know how to do that. Furthermore, if I apply carve SOP to the ground does not work. Why?

forestLoop_Displace.zip (18.5 KB)

Terrain generation
The terrain is generated from a grid deformed using a displacement shader that takes as input a 2D noise. The path to follow is generated by a displace TOP applied to a ramp, and added to the 2D noise in input to the shader.
Movement of the camera.
The X translation of the camera to follow the path is calculated from the amount of displacement which deforms the ramp.
Instantiating trees during the trip.
Here I have no solutions. The effect of the ground moving towards the camera is fake, generated by a 2D noise: its vertices aren’t moving along the Z axes. How can I instantiate the trees, place them at the right height, and translate them with the same speed as the noise?

Thank you for any kind of help!

Bump!
Any ideas?

mark

Lots of things to tackle here let me try and answer a part of it.

Your example file lacks the trees component so I’ll focus on creating the average path. It’s attached. This approach is very specific to your static input geometry but shows you one way to skin a cat.

I believe you need to invert the problem. You don’t want to know where to place the camera, you want to know where to carve the path. For maximum awesomeness you’d want to procedurally generate your cylinder. Anyway, I digress…

The attached file will generate the average distance between the two edges of your path.

I tried to use the computed average path as the path sop for the camera, but it doesn’t seem to be following… needs some investigation (bug? Dunno haven’t used a camera path before, maybe I’m doing it wrong) but at least shows you one way of processing your static geometry.

As to noise that repeats at a boundary, you’ll need to implement periodic noise:
gamedev.stackexchange.com/questi … rlin-noise

As for the trees, you’ll want to learn about real point instancing and avoid the copy sop if you want to do ‘serious business’. (derivative.ca/wiki088/index. … he_GPU_Vid). Bonus Pro-Tip: now days you can pass normals (rotate to vector) instead of computing your own rotations.
forestLoop_Cylinder_campath.toe (8.28 KB)