PDA

View Full Version : Creating counter like text using lwanimloader_hclass



polysNstrats
02-14-2008, 05:27 PM
First let me introduce myself since this is my first post to this forum. I've been writing lw 8.5 motion plugins for tracked vehicle animations for 2 or three years. My client paid me to learn Modeler and Lightwave which is really cool. I'm an independent contractor working from home in Utah and started programming on a DEC PDP-10 which dates me. I also do 3D simulation tools work and simulations using VegaPrime and create models using Creator. Different world. But I really love doing this animation work for one client.

I've never had to write numeric characters in a scene but got an order to add in some static and non-static text "Vehicle Speed ##.### KPH", where the ##.### is the non-static part and gets updated every frame, to a scene. I composite this over the frames I've already rendered of the vehicle moving down a road.

I came across a sample, ancounter.c, in the sdk samples which creates a time counter using the lwanimhandle_hclass and it works fine for my purposes with some changes of course, although I haven't figured out how to change the color of the text from black.

Having done all this I'm thinking there's got to be an easier way to do this. To invoke the plugin I have to go into the surface editor, select the surface used on the small poly I created to frame the text and hit the texture button. I then select the ".jpg" file (really just text file but with .jpg extension to fool the loader) I created that contains the key words that cause my plugin to be invoked. The file also contains the font name and size. This all seems awkward to say the least. It works and the client could care less how I do it.

Surely there must be an easier approach and I was hoping one of you plugin developers out there could perhaps enlighten me and suggest a simpler method or approach.

I just purchased LW 9.3 hoping (foolish me) that the sdk and especially the docs would have improved. Doesn't appear the 9.3 sdk I just downloaded has changed much from 8.5. Other than I can't use my dev 2003 or Dev 6.0 c++ compilers. I caught the thread about how to get 2003 to build the server lib. And I wasn't aware that MS had a free (Express) compiler so I learned a lot today already.

Paul

Lightwolf
02-15-2008, 04:09 AM
I just purchased LW 9.3 hoping (foolish me) that the sdk and especially the docs would have improved.
They're actually not that bad compared to other 3D apps out there...

Other than I can't use my dev 2003 or Dev 6.0 c++ compilers.
Of course you can, I've used anything from MSVC 6.0 to 2008 to compile LW plugins... and there have been no basic changes to the SDK that require a newer compiler.

Back to your original question though.
One thing you could do is create an image filter plugin... write the text to a temporary image buffer and then manually compose it over the final render as the plugin gets evaluated.

The advantage is that the imagge filter gets saved with the scene and allows for a panel, so the user can change the settings within the scene.

Cheers,
Mike

KeystoneMike
02-16-2008, 01:44 AM
If your final output is going to be rendered and not just openGL previews or realtime then you don't need to do any programming at all.
IFW2 can do what you are needing right now.
www.shaders.org

IFW2 Nodal has a Display node that will let you do text using whatever fonts you have. And it's very easy to drive a numerical output using simple expressions.
A couple of polygons parented to your camera where you can see them with the appropriate surfaces and you are in business.

-Mike

polysNstrats
02-16-2008, 09:47 AM
They're actually not that bad compared to other 3D apps out there...

Of course you can, I've used anything from MSVC 6.0 to 2008 to compile LW plugins... and there have been no basic changes to the SDK that require a newer compiler.

Back to your original question though.
One thing you could do is create an image filter plugin... write the text to a temporary image buffer and then manually compose it over the final render as the plugin gets evaluated.

The advantage is that the imagge filter gets saved with the scene and allows for a panel, so the user can change the settings within the scene.

Cheers,
Mike

Mike,
Thanks for the quick reply. As to the compiler for the plugin, you are right of course that my 6.0 and 2003 compilers will create plugins for LW 9.3. Its the sample plugin projects that came with 9.3 that require 2008 to load. I loaded some plugins I created for LW 8.5 and they run fine in 9.3.

And thanks for the tip on doing an image filter plugin. This might give me better looking text than I get with the animHandler plugin. And it would be a time saver to have the plugin saved with the scene and not have to re-load each time I load the scene. I'll have to play with it this weekend while I've got some extra time.
Paul