• Welcome to World Machine Community. Please login or sign up.
October 17, 2019, 03:55:25 am


Read the Development Diary for an inside look at World Machine's progress!

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - howardzzh

Hi all,
     I've just updated the terrain merger plugin to World Machine 2. The dlls and example files can be found at http://www.howardzzh.com/research/terrain/worldMachine/index.htm. Please let me know if you have any problem getting it to work. Good luck!

Notice: The current plug-in only works with WM2 Basic. I am trying to make it work with WM2 Pro. I will keep you updated. Sorry about the inconvenience.

First, thank you all so much for your encouraging comments.

I've update the .dll files and removed the support for presets. As for the progress report, I have been thinking about it since the first PPA device. However, I still haven't come up with a good way of calculating the time needed without hard-coding it into the device. For instance, the Seam Remover solves a linear system equation at once, and currently, I cannot think of a good way to report the progress. Do you have any suggestion?

Regarding to your last question, I've added one example to the help page. Basically, when a mask is not provided, the Seam Finder automatically generates a mask which sets two sides of the rectangle to be the source, and two others to be the input.

Yes, I will try to finish the next part sometime in the future. However, I still do not have a good idea on how to connect the next part to World Machine yet, the best bet is the layout generator kind of approach, but I will need to do some homework on that before I can really start. Once I have a solid idea, I will setup a release date on the webpage.

It probably will take much longer to run these devices at a higher resolution. In the original implementation, I used small patches and made up a large terrain piece by piece. Now instead, the procedures are run on the entire heightfield at once. The next part of my work is to figure out how to work the piece-wise approach into the World Machine framework. Any suggestions?

By the way, I would really like to see some cool examples using the devices (although it would be a pain to generate high resolution ones right now).


Hi guys,
    Sorry that I missed deadline twice. Hopefully, this update will make up for it.
    You can download the new device from http://www.terrainsynthesis.org/worldMachine/index.htm.
    This update includes both the seam finder, seam remover, and an example project file to show you how to use these to seamlessly merge two height fields. To be able to use the plug-in, you will also have to download some additional dll files which is also listed on the webpage.
    Meanwhile, I will start writing a detailed tutorial page about this device in a couple of days. Please let me know if you encounter any problem. Thank you.


Update 2007-08-17:

The device help page is now up.
Hi Monks,
    That's a very interesting idea. Just like what you said, there is currently no concept of order (or structure) in the PPA result. I was looking into how to bring the Strahler stream order to the analysis program, but it got pushed over by other things. However, it's always something I wanted to try, to give orders to the output of PPA. That way, we might have a culling threshold that makes more sense; that is, instead of removing branches depending on some heuristic threshold (such as the short branch threshold or end point threshold), we can choose not to show the branches with stream orders lower than the threshold.
    I am pushing for a tight deadline right now, so I might have to postphone the release of the second module, but hopefully, I will have more time to experiment with this idea after August 7th. If you are interested, I can send you the source code for the PPA procedure. Sorry for the short response, back to work.

To add some details on the development plan and also a call for help, I am just gonna shamelessly copy the post I left on the Terrain summit forum here.

"As far as the development plan goes, the next two parts: seam finder and seam remover are, imo, more useful in terms of height field manipulation. When both devices are combined, they act as a height field combiner sort of filter. That is, given two height fields that you want to put together, the seam finder will find the best seam from where the two height fields can be joined (assuming their relative positions are fixed). Once the seam is identified, the seam remover will remove the height difference along the seam while preserving the details around the seam region.

With the experience gained working on the PPA ridge/valley picker plug-in, I am now quite comfortable with converting the rest of my code. However, I am not quite sure how these devices should be integrated into the World Machine work flow yet. I am looking for suggestions on how you may want to use the devices. Especially ideas on how this can be combined with the layout editor, since the last part of my entire algorithm is just a layout planner."
Thank you, Carl,
     I could not figure out how to dynamically reset the slider value, so the slider is set internally when the "Terrain Type" is switched. The slider will be reset if the device is closed and reopened. Any suggestion on how dynamically reset the slider would be greatly appreciated.
     Also, this ridge/valley picker device is just an analysis tool. Without the proper support, it would probably be useless. I am working on the rest of the devices, and I will try to keep up with the posted release dates. Thank you.   
Thank you, Alex. I just posted the first part of the plug-in series here, I will start working on the next part and hopefully, I can finish them before the WM Pro version comes out.
Hi guys,
    I've just finished the PPA ridge/valley picker plug-in for WM Pro Beta 5. It is the first part of the terrain synthesis from DEM devices that I am developping. You can download the plug-in (including a simple example) from here. To be able to use the plug-in, you will also have to download some additional dll files which is also listed on the webpage. Please let me know if there is any problem. Thank you.
Thank you for clarifying this.
Thank you Remnant.
     After using WMAlloc() to allocate the memory for the TextPacket body, I no longer get any exception from switching between different views. However, I still have two questions.

1.  Was the function "void TextPacket::setText(const char *txt)" defined in the libraries included in the PDK? The reason I ask this question is because it showed up as an undefined reference for me when I built my device. That's why I have to write my own setText function which is probably incorrect. I would like to use the official version if somehow I just missed.

2. I probably used the text output device in an incorrect way since I still could not get it to write any text to a file.

Here is how I added a second output port in the constructor
    AddPort(0, 1, WMP_text, -1);

Here is how I tried to store the data to the output

bool PluginPPA::Activate(BuildContext &context)
    StoreData(txtBranchPoints, 1, context);

I also tried to simply link the "Text input" device to the "Text output" device and could not get it to output a text file.  What I did was to link it to a text output port, build the whole thing, specify the output filename, and then click the "Write ouput to disk!". I wonder if I did anything wrong with the "Text output" device. Thank you for the help.
Hi everyone,
    I encounted an linking error while outputing a TextPacket from a device that I am creating. The error message said that void TextPacket::setText(const char *txt) is an undefined reference. I wonder if it's because the library file wasn't included in the PDK or if the function is not defined yet.

I've temporarily bypassed this problem by defining my own inline function in the TextPacket.h to overide the default setText.

inline void TextPacket::setText(const std::string& txt)
   int len = txt.length();
   body = new char[len+1];
   memcpy(body, txt.c_str(), len);
   body[len] = NULL;

However, I could not get the "Text Output" device (which is hooked to the text output of my device) to write a file to the disk. There is no error or warning, just that the "Write output to disk" didn't do anything. Also, after the device is built, it will result an exception whenever I want to switch to either the "Layout view" or the "Explorer view". The device behaves fine if I just swith between the other views.

I wonder if I missed anything here. I would really appreciate your help if you've had similar experience. Thank you!

Excellent! Just what I wanted. Thank you so much for the help!
Hi guys,
     I have a really beginner's question; how do you go about debugging while write the plugin code? Is there any other way to spit out text besides the text output in the WM Pro. So far, I couldn't find any way to enable console output. I would really appreciate any help. Thank you!
I've just wrote a simple downsizer plugin. It's both a test for the new WM Pro PDK, and a component of some plugin I am developping right now. I don't know if the device can be useful in any meaningful ways, but since there is yet a resizer to appear in WM Pro, I thought it might be useful. I've also included the source in case you want to see yet another example (project built with VC 2003). Just put it in the Beta 5 PDK folder and you should be set.

Downsizer plugin

I was modifying the PDK examples for some plugins I am writing when I first noticed that the plugin DLLs would cause an exception if we try to save the device in a .tmd file. I am currently developing on visual studio 2005, so it is very likely to be a compatibility issue. Don't know if it helps or not, I do notice that the exceptions always occur near the vfptr (virtual function pointer). I wonder if anyone has encountered similar issues before? I'd really appreciate any help. Thanks!
General Discussion / Re: New Device: LEGO Filter
May 29, 2007, 09:25:50 pm
Wow, this device is awesome. I am having lots of fun with it. Thanks!
General Discussion / Re: Terrain Synthesis from DEMs
March 22, 2007, 08:33:25 pm
Hi guys,
    First, thank you all very much for the emails and comments about this paper. My name is Howard Zhou and I am one of the authors. I am a long time admirer of the work that has been done here, and I am really glad that our work can help spur some interesting discussions in the forum. I especially like the terrain sampling idea because I also think it's a much better way to utilize the gazillion bytes of DEMS we have. Maybe in the future, we can go so far as to try reverse engineering on a real terrain heightmap to create a procedure model (erosion model for instance).
    If you guys are interested in the actual implementation details or limitations of the system, I will be happy to discuss them here. Feel free to ask any question and I will try my best to answer it.