Face Me Script

Get technical support about the C++ source code and about Lua scripts for maps, entities, GUIs, the console, materials, etc. Also covered are the Cafu libraries and APIs, as well as compiling, linking, and the build system.
Post Reply
User avatar
arfur9
Posts:90
Joined:2017-02-25, 18:57
Location:uk
Contact:
Face Me Script

Post by arfur9 » 2017-03-13, 15:31

Would it be possible to have a script which turns a single plane object so its front face is always in line of sight?
Sketchup has Face Me components and I believe some game engines can do the same..
also a way to scatter a load of objects would be good :)

Its very useful for grass and tree billboards
User avatar
Carsten
Site Admin
Posts:2170
Joined:2004-08-19, 13:46
Location:Germany
Contact:

Re: Face Me Script

Post by Carsten » 2017-03-14, 11:42

There is no readily available solution that works out of the box, but I think that the easiest is to hack the ParticleSystemOld component in order to achieve this. It's mostly likely not even particularly difficult, but it would take a bit time to implement it. Do you have some C++ developer who can help you?
Best regards,
Carsten
User avatar
arfur9
Posts:90
Joined:2017-02-25, 18:57
Location:uk
Contact:

Re: Face Me Script

Post by arfur9 » 2017-03-14, 13:33

sadly I'm not a C++ programmer or know anyone that would be interested, I managed to do some projects than I'd already done in C# converted to QT/C++ but its not that difficult if its your own code
User avatar
Carsten
Site Admin
Posts:2170
Joined:2004-08-19, 13:46
Location:Germany
Contact:

Re: Face Me Script

Post by Carsten » 2017-03-14, 14:30

Ok. Well, I can look into it, it may even help a bit with the GUI issue #157.

Can you describe a bit more detailed how your grass / trees are supposed to look like? That is, how many billboards do you have, how and where are they supposed to be used, etc.? Also a few sample textures/materials would be helpful.
Best regards,
Carsten
User avatar
arfur9
Posts:90
Joined:2017-02-25, 18:57
Location:uk
Contact:

Re: Face Me Script

Post by arfur9 » 2017-03-14, 16:12

In Blender the "Face Me" can be done by passing the camera rotation value to the object, obviously some values are constrained
Sketchup the 2D model in the default template is also a face me component
Its also useful if you wanted a surveillance camera follow the character

I just looked at GameGuru and that uses a more basic approach they use 2 planes at 90 degrees to each other
Something like:
https://dl.dropboxusercontent.com/u/265 ... las_ms.rar
I just quickly did that, the material isn't right

Scattering stuff at a basic level its the ability to scatter objects on a named surface and maybe randomize rotation and scale and distances between each other

I just thought it would help if you plan to do terrains, I think Unity and GameGuru just use simple planes which can be adjusted depending on the quality setting and only visible in game
User avatar
Carsten
Site Admin
Posts:2170
Joined:2004-08-19, 13:46
Location:Germany
Contact:

Re: Face Me Script

Post by Carsten » 2017-03-15, 11:22

Yes, you can use the 2-planes approach. That's how the plants are made in the TechDemo map:
https://www.cafu.de/images/gallery/techdemo/pic0000.jpg
https://www.cafu.de/images/gallery/techdemo/pic0005.jpg

Same technique, but with models not in Cafu, made by others:
https://www.cafu.de/images/gallery/outd ... thrawn.jpg
https://www.cafu.de/images/gallery/outd ... tops_1.jpg
https://www.cafu.de/images/gallery/outd ... tops_2.jpg

If you can do it like that, it is surely the simplest approach that gives the quickest results (because no coding is required) any may even look better than plain billboard sprites.

(An entirely different technique, from a project that I did at university and of which I wished I had finally time to implement it in Cafu: https://www.cafu.de/gallery/ --> select "outdoor" --> the orange morning sky)
Best regards,
Carsten
User avatar
arfur9
Posts:90
Joined:2017-02-25, 18:57
Location:uk
Contact:

Re: Face Me Script

Post by arfur9 » 2017-03-15, 12:52

The skies look really nice :)

Did you do the clouds?
User avatar
Carsten
Site Admin
Posts:2170
Joined:2004-08-19, 13:46
Location:Germany
Contact:

Re: Face Me Script

Post by Carsten » 2017-03-15, 20:44

While I can only vouch for the sky domes that ship with Cafu, I'm quite sure that all of them were made with Terragen, http://planetside.co.uk
Best regards,
Carsten
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests