• Welcome to the Community Forums at HiveWire 3D! Please note that the user name you choose for our forum will be displayed to the public. Our store was closed as January 4, 2021. You can find HiveWire 3D and Lisa's Botanicals products, as well as many of our Contributing Artists, at Renderosity. This thread lists where many are now selling their products. Renderosity is generously putting products which were purchased at HiveWire 3D and are now sold at their store into customer accounts by gifting them. This is not an overnight process so please be patient, if you have already emailed them about this. If you have NOT emailed them, please see the 2nd post in this thread for instructions on what you need to do

RELEASED The "Scatter Tool" plugin for Poser

Ken1171

Esteemed
Contributing Artist
And for today's update, I have studied a bit more trigonometry to solve the most exception-ridden case of scattering over a solid - the cube. That's because tangents cannot be calculated (+/- infinite) at the poles, so I have to handle these as exceptions.

The idea was to handle this first, and then try to generalize the code to work with any solid. So far it works on a cube. :) If I can make it work on a sphere, it should work on any surface.

ScatterOnCube.jpg
 

Miss B

Drawing Life 1 Pixel at a Time
CV-BEE
That much I know, but I thought it was a limited time contract of sorts.
Initially it was just that, but then I guess they were so happy with his work, they offered him a full time position.
 

Miss B

Drawing Life 1 Pixel at a Time
CV-BEE
I have a huge amount of his products, but I don't know if that's what he's doing for them now, especially since he's not working in Poser. I took a class with an educational version of Maya, but don't know enough about it to know if they use Python scripting for add-ons and such.
 

KageRyu

Lost Mad Soul
Contributing Artist
At one point Netherworks had some educational videos for sale. I do not remember if any involved scripts or python, and I do not know what happened to them. Let me check to see if I have any contact avenues for Netherworks - we had talked about a few projects at RuntimeDNA.

It is a shame so many of those that did so much to push the capabilities of poser have retired or passed on.
 

Ken1171

Esteemed
Contributing Artist
The alignment code is starting to get somewhere. I've got it to work on a:

* Flat plane
* Morphed plane
* Cube

and now I am trying the final challenge, the sphere. If it works on the sphere, it works anywhere.

AlignedToSurface3.jpg

At first it may look like it's working, but not quite. Trigonometry changes rules at different quadrants, so things appear to work well in one side, but get twisted in others.

At first, the code that worked on planes didn't work on solids, but now I have switched from tangents to arc tangents and arc sines to avoid some of the trigonometry pitfalls. This code looks more promising because it has worked on both planes and solids, but will require some special considerations for different quadrants on solids.

I will have to brush up my linear algebra to solve this last part. It's finally looking like it's getting somewhere. The goal is to get the same code to handle all cases, and this is where it got so far. ;)

Performance seems pretty good. It spawns 50 cylinders over the plane, cube, or the sphere in about 1 second.
 

Ken1171

Esteemed
Contributing Artist
If only our teachers in school had told us math would be so important.

Haha I was talking about that the other day with my wife! :roflmao: We can build entire 3D visualization systems with just linear algebra and trigonometry. My teachers never told me that when I learned that stuff back in the day. It would had been much more interesting and fun if I knew what it meant, and where it could be applied.

However, I was also a math teacher at some point, and I didn't know this either back in the day. So maybe my math teachers didn't know this either, and they couldn't tell me what they didn't know. Computer Graphics is one of the 5 fields covered in computer science. Imagine my surprise when I started the course, and learned what that stuff was all about. I wish I knew then what I know now. ^__^
 

Ken1171

Esteemed
Contributing Artist
I have been working hard to solve the trigonometry issues with Euler rotations out of Poser normal vectors to align props to the surface of solids. Wow, that's a mouthful, isn't it? LOL

Disclaimer: In the following lines I will take you through a trip into the third and FOURTH dimensions. Not recommended for the weak of heart. Some things will turn to the Dark Side, where black holes, madness and some hysterical ladies live. You have been warned.

Many of the trigonometry "black holes" were covered, but we still have issues close to the equator, as seen below. As Y approaches zero at the equator, the trigonometry ladies go hysterical. What we see below is the visual explanation for why Euler rotations suck. I thought that solving the poles would be tough, but the equator seems even crazier. They should have been locked up at the Arkham Asylum long ago, but you know, they always manage to escape and come back to haunt us.

One could argue that this was supposed to be simple: I already have the normalized normal vectors, and all I need to do is convert them into Euler rotation angles. How hard could that be, right? If you have used Poser for long enough, you might have tried to orient the camera by dragging that ball on the left side - that's controlled by Euler rotations. When we get to right angles (the cardinal points), the camera freaks out and jumps to random places, apparently out of control. If you have tried that, you will understand why some sticks below go crazy, even when I am giving them the correct angles. Below I have solved the poles, but the equator still freaks out. Trigonometry seems so elegant and exact, but hey, it also goes crazy. Our teachers have rarely mentioned the madness behind calculating triangles, and how they can easily betray you by turning to the Dark Side. They look cute and cuddly at first , until you eventually face their true evil nature. Chaos rules even math! LOL

AlignedToSurface4.jpg

This is one of the reasons why math came up with "quaternion" rotations - they don't go crazy, but we have to tap into the 4th dimension to produce them. That's why they get that name (quat = 4). But hay, Poser only works in 3 dimensions, so how would a 4D rotation help? Well, a single quaternion indeed rotates in 4D, and cannot be used in 3D. But when we combine TWO quaternions, the intersection between them ends up joining one common axis, producing a gridlock-free 3D rotation! Hence the name "dual-quaternion" (DQ).

But Ken, isn't that just used in game engines, and the DS4 platform? Nope, Poser has quaternion rotations as well! It just doesn't use them on the interface (because it hates you). So first the good news: DQ rotations are available through the Poser Python API. That's great, right? Yes, and now comes the bad news - the documentation is poor, leaving things to the imagination. DQ math uses linear algebra with matrices, and Python has wonderful libraries to do just that, but we can't use them in Poser because it uses it's own Python installation. We can't install libraries as far as I know. Even if I could, the library would only exist in my computer, so my code would only work here.

I am hence itching to switch to dual quaternions to get rid of the Euler rotation madness, which brings us closer to the Dark Side with lack of documentation and support. However, the Dark Side is very seductive, and sometimes it's hard to resist it.
 
Wow, this looks amazing and like something I've been hoping for for a long time! Is there an ETA on when it will be released? (Sorry if it's been mentioned already as I missed that.)
 

KageRyu

Lost Mad Soul
Contributing Artist
Perhaps some of these suggestions on the Poser Python implementation and documentation would be good to bring to Poser's new owners? After all, if the tools to develop and expand Poser are better tended then it would surely attract more support? I'm trying to follow the thread, but I am not a programmer, and I never took math past advanced algebra (most of which I do not remember). The last programming I did was basic on a c=64 with a touch of machine code. While I did teach myself and do a fair bit of HTML3 and Javascript, I haven't done any of that since 2004.
SWtill, I'm hoping I may learn something useful.
 

Ken1171

Esteemed
Contributing Artist
Wow, this looks amazing and like something I've been hoping for for a long time! Is there an ETA on when it will be released? (Sorry if it's been mentioned already as I missed that.)

Thank you! It has been something I wanted for a long time as well! If there is something I have learned here at HW is that when we want something, but nobody is making it, you have to choose 1 of 2 options:

* Ask someone to [hopefully] make it.
* Make it yourself.

If time passes and nobody has made it, then it's time for the 2nd option, because the only other alternative would be to complain about it. I first saw scattering in e-On Vue, and I was fascinated by what we could do with it. More recently, there was a free update for Paintshop Pro that added "jitter" options for existing brushes - a way of scattering things around in 2D. I immediately thought - I want to be able to do this in Poser, but using 3D objects instead! That's where the "Scattering Tool" idea was born. Mind you, I won't be winning any prizes for original tool names, but I am happy with what it can do already! ^____^

Perhaps some of these suggestions on the Poser Python implementation and documentation would be good to bring to Poser's new owners?

Believe me, I have tried. I used to be part of the SMS beta-testing team for years, and could interact directly with the Poser dev team by the time when Chuck Taylor was their product manager. So much that a couple of the features you find in Poser 11 Pro were my personal suggestions. For example, the "rotation" brush in the Morphing Tool, and the extended Python commands to manage which objects are affected by magnets in Poser were my personal requests. The workaround process to create JCMs in unimesh geometry was also part of my discussion loop with Larry Weinberg.

However, when they transitioned to Rendo, I have tried to contact them in different ways, but could never get a reply. After getting the cold shoulder for a couple of months, I just understood they won't talk to me, and that's about it. I would like to keep contributing to the future of Poser, but looks like I can't get in anymore.
 

parkdalegardener

Adventurous
Ken my old machine died with PP2014. When it was up and running there was a Poser Fusion Plugin for Vue. One of the options was to change the Eular rotations to DQ rotations that Vue uses. It was done in the plugin itself I believe. I know that doesn't help any, but it does seem possible that the Poser Python implementation can be accessed to do the heavy lifting. I just don't know enough to help.
 

DanaTA

Distinguished
@DanaTA it was very much meant tongue in cheek - as that was said repetitively daily.

I hated Algebra in high school. So much so, that when I went back to school, 20 years later, it was an Achilles heel. I had a perfect 4.0 GPA until I had to drop out of Elements of College Math because I was lost. Refresher course in Algebra brought my GPA down to 3.95. It's the only class I didn't ace. But I did ace Elements of College Math after the refresher!

Dana
 

Ken1171

Esteemed
Contributing Artist
I know that doesn't help any, but it does seem possible that the Poser Python implementation can be accessed to do the heavy lifting. I just don't know enough to help.

The Poser manual mentions we have access to DQ to control rotations, but it just lists the commands. It's like learning a new language by reading a dictionary. Sometimes just a single example would suffice, and the manual has a place for them, but most were left empty, like they were expecting to come back later to fill them out, but never did. It's just a matter of time until I figure it out.
 

Miss B

Drawing Life 1 Pixel at a Time
CV-BEE
I hated Algebra in high school. So much so, that when I went back to school, 20 years later, it was an Achilles heel. I had a perfect 4.0 GPA until I had to drop out of Elements of College Math because I was lost. Refresher course in Algebra brought my GPA down to 3.95. It's the only class I didn't ace. But I did ace Elements of College Math after the refresher!
Hmmm, and I hated Geometry and Trigonometry in high school, but liked, and excelled in, Algebra. I guess that's why I took to programming so easily when I went for my degree in CIS. If I had the spare time, I should take a class in Python. I've thought about it more than once, but never got around to it.

My Achilles heel when I went back to college was Macro Economics. Then again, the Professor was boring, which didn't help either. I need to like a course in order to do well in it, and he didn't make it easy. I think most of the class felt that way.
 

Ken1171

Esteemed
Contributing Artist
Today I have spent some time examining what we have for dual quaternions in Poser Python. It comes down I can read a rotation quaternion from an actor, but cannot write it back. In other words, quaternions cannot be used to set a rotation, but only to read it from something that has already been rotated. Lost cause here. This doesn't mean Poser cannot set quaternion rotations, but instead that I don't have access to that with Python.

However, I have figured a way around to calculate surface alignment in Poser that doesn't require linear algebra, trigonometry, or even Euler rotations. I am testing the idea in code, and so far the results have been promising. In my early tests, it has worked with planes and solids! Yay! I will post more about this later on, when do more testing and have something to show. ^^
 

Ken1171

Esteemed
Contributing Artist
After some creative process, here are the results of my brand new surface alignment method. It works on flat or morphed planes, and solids as well. By removing trigonometric calculations, the alignment distortions and Euler rotation angle aberrations are all gone. I no longer have to deal with that.

Let's start with a morphed plane:

AlignedToSurface6.jpg

And now, on a sphere:

AlignedToSurface5.jpg

This method eliminates all the distortions I was having with Euler rotations, so now every alignment is perfect. By removing Euler rotations from the calculations, I am no longer having to resolve angle discontinuities and pole aberrations. This method requires more tasks, so the performance is not as great, but it is still fast. I still want to optimize it to squeeze the maximum performance out of it.

Even if we deform and morph the sphere, the new method can still align props perfectly over it. In the beginning it was different code to handle planes and solids, but now it's all covered in a universal solution that can handle everything. Time for some optimization now.

AlignedToSurface7.jpg
 
Top