Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2025 Feb 05 6:41 am)
Uh - notwithstanding the issue of it not working on OSX, I don't see how this works at all.
To calculate which way the billboard should face, you have to compute the vector from the billboard to the camera.
Consider a camera that is at 0,0,0.
Consider two billboards - one that is north of the camera (-z) and one that is south of the camera (+z). These two billboards must face in opposite directions. The northern one must face south, and the southern one must face north.
Further, consider the dolly camera. When it rotates, it doesn't move - it just points to a different place in the scene. A billboard that is always facing this camera should not rotate just because the camera has rotated. It should rotate when the camera moves.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Its not a very big deal, but that is one of the example scripts that is included with my Python for Poser Manual. I'm not suggesting that I have copyright on every code block under the sun, rather the manual and its examples is intended to help you write your own scripts. Duplication of standard routines is inevitable and to be expected. I would however prefer that the scripts not be redistributed cart blanch or as in this case with just my explanatory header removed.
Yes it does appear that I have "typo-ed" and included the import and scene lines twice.
Can not say at this point why its not working on a Mac other than to echo semidieu's comment that Mac Python can by picky.
Sorry about that Phil: I just copied and pasted the billboard section from a longer python script I'm doing in a new file, forgetting to put your author header.
I reuploaded the file with the header included. If you wish the file to be removed, please tell me and I will do it...
visit my
blog: www.alessandromastronardi.com
My
Rendo Store
Quote - Uh - notwithstanding the issue of it not working on OSX, I don't see how this works at all.
To calculate which way the billboard should face, you have to compute the vector from the billboard to the camera.
Consider a camera that is at 0,0,0.
Consider two billboards - one that is north of the camera (-z) and one that is south of the camera (+z). These two billboards must face in opposite directions. The northern one must face south, and the southern one must face north.
Further, consider the dolly camera. When it rotates, it doesn't move - it just points to a different place in the scene. A billboard that is always facing this camera should not rotate just because the camera has rotated. It should rotate when the camera moves.
Hi BagginsBill, most examples I found about billboarding techniques in general, they take into account only camera rotations (checked also some opengl tutorials on gamedev.net).
Afterall, if you move away the quad in front of you, say to your right, before it disappear from sight, even if it's not billboarding you won't notice it.
visit my
blog: www.alessandromastronardi.com
My
Rendo Store
I'm not at all tracking what you're saying.
All the discussions of the technique on gamedev speak of camera position relative to the billboard quad, not camera orientation.
Example: http://www.gamedev.net/community/forums/topic.asp?topic_id=411132
Specifically, a ring of billboards surrounding the camera would all be facing the camera, each with a different normal. In the algorithm you're using, they'd all be facing in the same direction, with the same normal.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Here's another one - uses camera position.
http://www.gamedev.net/community/forums/topic.asp?topic_id=452635
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
I see some people using the view plane, not the view position. This is equivalent to what you're doing. But they note that it's not the same, and comment that it is "good enough". Maybe it is for some things. If, however, you have a wide angle camera, I doubt it's good enough.
http://www.gamedev.net/community/forums/topic.asp?topic_id=583098
The OP says:
Quote - Thanks for the quick answer. I had to revert the order (first rotate, then translate) but now it works. I assume this method doesn't align the billboards towards the view point, but the view plane instead, though this shouldn't really be a problem for me: It looks good enough.
But then another poster points out the camera position formula.
This article explains the difference quite well, and illustrates what is wrong with ignoring the camera position:
http://www.flipcode.com/archives/Billboarding-Excerpt_From_iReal-Time_Renderingi_2E.shtml
About halfway down it explains the difference between viewplane aligned and view point aligned and why it matters. Perhaps it's OK for the scenario you plan to use, but the anal retentive in me would force me to do it right.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
BagginsBill, I totally misunderstood your first point, now I see what you meant. Thanks for those links about billboarding, indeed they show in detail how to achieve that and explain the theory behind it.
I will try to build a billboarding routine following those, expect more disturbing question :-)
visit my
blog: www.alessandromastronardi.com
My
Rendo Store
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
Attached Link: billboarding.py
Attached here is a simple script for billboarding: it works fine in all Windows Poser versions, while in OSX it works only on Poser 7 and Poser Pro. On Poser8 and Poser Pro 2010 (OSX versions) it crashes as I start to move the camera.Maybe someone could confirm the above behaviour and maybe understand why that happens ?
Thanks you
visit my blog: www.alessandromastronardi.com
My Rendo Store