Cam movement (lookat) problem

Hi @ll!
I want to create a simple game with vvvv.
The cam have to follow the street that is generated as a 3D grid(ex9) (girlpower/retro machine with arbitrary from kalle) like a car and have to look a few vertices ahead. I tried to solve this with lookat, but it doesnt seemed to work. The cam “jumps” or isnt in the wished direction. Im a novice in using vvvv and I found only one explanation for “lookat” especially for the upvectors (this might be the prob). I didnt get it. Please have a look at my patch and give me a hint how to solve the cam-movement.

@kalle: thx for the arbitrary!

kind regards

???.. no text …

@kalle: this kalle.modules.ex9.geometry helped to get an arbitrary grid(ex9) out of the retro machine for export the street as a x-file (see test.x in my link).
…or what are you asking for?

ahhh. got it. you are welcome.

regarding your problem: search this site for “upvector”, i am sure that gregsn has written something very intelligent somewhere around here.

please attache files to your post directly… files or pictures hosted elsewhere tend to disappear after some time.

Here again the files.
Here comes the link how I wanted the Cam moving forward:

@Kalle: searched for 3 days. there is only one explanation (here):
But I don`t understand it until yet. Sorry!

This Patch takes a x file and place boxes aso at it. The not working Cam-movement is on the upper right side in the patch (420.9 kB)
this is the x-file. please name it “test.x” and load it into the xfile-node lower left sid in the patch. (49.7 kB)

instead of moving the cam along the street by taking the vertices out of it. it might be much easier to model a cam path over the street model in a 3d program and import it as geometry too. then use b-spline or another interpolation method to move from vertex to vertex of the cam path.

I thought I could solve it in vvvv, because I have already the vertices out of the street for moving the cam. Additional to that I want to create a lot of streets. So the solution have to be more variable than creating a cam-path manually afterwards. But many thanks for this suggestion tonfilm! That might be a solution for one static street. I ll try it if I find a way to open x-files in Cinema.
I play around a bit and now the cam (without “lookat”) is moving along the vertices. Only the right angle is missing at the curves.

vvvv-file (103.7 kB)

hmm could’t find “upvector” also
but if you connect cartesian node to lookat you would have flip on pitch 0.25 and -0.25 and most strange about that is that cartesian value range jumping from 0.4999 to -0.5…
that nasty flip freaks some time’s normally i avoid that with rotate transform…

I found “upvector” in the www. Its the cam rotation at the choosen axis (google is my friend). Whatever that means and however that will help, because I dont believe the Upvector-Pin is declared in angles or in a value range.

Anyway; I tried antokhio rotate advise (thx for that idea). Now I can move my cam with a simple rotate (multiplied with the cam view projection). Manually it worked great, but I still dont know, how I can choose the angle automatically for the rotation pins. I think the solution have to do with the difference of the positions of the taken vertices. I wish my knowledge of math would be better.

The next prob: if you rotating the cam, the renderer sometimes doesnt display the objects… (Cam: Initiall Interest-Pin settings are wrong?)

So here comes the solution manually operated (play with the roate node). I uploaded also a new x-file, to make it a bit more interesting.

Please let me know if someone knows how to generate a automatically angle recognition.

vvvv-file (104.3 kB)

Here is the x-file as txt. you have to rename it as test.x and upload it into the xfile-node in the patch.

test.txt (50.7 kB)

LookAt is still the better option, you select the next vertex as the look at position. and interpolate to the next two vertices.

then you don’t need to deal with angles in 3d, which is a nasty topic.

Bakerman_loader_1.v4p (104.8 kB)

Wow, thats it! Im really impressed! 2 min ago it took a load off my mind.

I was nearly to abandon hope, but now the multipurpose toolkit is back in my life. I knew that you can do almost everything with vvvv. I lovvvve it!

Thank you very much tonfilm!

Sounds like some beer next node.

your welcome!

if you have a generative way to make the tracks, please tell me. it would be a nice girlpower patch.

I zipped the whole project for you. Its still in progress, but the (now cheerful) Bakerman roadgenerator is ready to use.
The minute the project is designed and fully tested (some logical mistakes are still in there, because of the growing and growing project) Ill post it again.
I wish I had more time…


  • If someone wants to create cool design stuff for the project (lights are still missing; background is black; player, bads and goods are not designed a.s.o.), feel free to implement and share it for some learning lessons.

  • The Bakerman roadgenerator purpose is only to generate nice level as xfiles.

Bakerman Project v2.2 (365.3 kB)