How to "Move Camera" in 3D space?

lifemusic's picture

I'm developing a piece that uses sprites and the built-in particle-systems to represent the planets of our solar system. I have the planets (QT.movs, projected onto sprites) revolving around the Sun in 3D space, all looks fine. The "camera" POV is situated in the plane of the ecliptic, somewhat outside the orbit of Saturn.

However, I would like to transform the camera POV so that I can observe the solar system from the polar areas, i.e. "above" or "below" the plane of the ecliptic.

I've tried embedding my composition inside a Trackball, and 3D transform macro, but these seem to have no effect on sprites or particle systems.

Is there some means of doing this? Or do I have to write a 3D perspective shifter myself in the math patch?

thanks bruno

hyprctv.farbraum's picture
Re: How to "Move Camera" in 3D space?

Hi Bruno, if you are using movies/images for your planets, you should use billboards instead of sprite. sprites are quads in 3D space and you wont see them from top view. billboards "look" always at you, so their textures will be visible from every POV and should be usefull for you solar-system. Particle are represented by billboards, so their orientations arent effected by trackball/3d rotation transformations.

The use-case "Solar System" is a good example how to use scenegraphs, i.e. a tree graph with a lot of transformations and geometries (planets in you case) at its leaves.

Scenegraph in qc can be achieved by using 3d transformations and subpatches. In this case the root will be represented by the sun: 3d transformation with geometry INSIDE. All other planets will be placed with 3d transformation INSIDE of the sun 3d transformation.

Now: By changing the top transformation, you can set the desired POV.

Good luck

Janni

lifemusic's picture
Re: How to "Move Camera" in 3D space?

Thanks Janni. I didn't realize that distinction between sprites and billboards.

I will investigate the scenegraph structure you describe. I thought I was already doing something like that, i.e. a 3D transformation containing all my other geometry.

thanks bruno

lifemusic's picture
Re: How to "Move Camera" in 3D space?

That worked - my problem was that, for organizational reasons, I'd been rendering the various planet sprites into a macro "Render in Image", then drawing them with a billboard.

But now that the 3D transform is working correctly, the problem you mentioned - that sprites don't always face the viewer - is very evident. I would use billboards, but they don't have a Z position component.

Is there any patch that behaves like a sprite in having X,Y,Z inputs, but always faces the viewer like a Billboard?