Sun, Nov 10, 9:02 AM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 10 8:20 am)



Subject: 'Point at' along only 1 axis?


Ahkreeah ( ) posted Tue, 16 October 2012 at 5:49 AM · edited Fri, 20 September 2024 at 11:43 AM

Hello,

I'm trying to get a figure or prop in Poser to point at another figure (the main camera) while only rotating on one single axis. I tried use the "point at" function under the Object Menu, but then all the axises move. I also tried parenting the prop to the main camera, but even when I set the min and max values of two axises to 0, it still moves on all axises.

A quick example of what I want to do:

  • I have a teapot on the floor, it's rotation values are rotateX=0, rotateY=0, rotateZ=0. The camera is rotateX=0, rotateY=0, rotateZ=0.
  • I move the camera to rotateX=80, rotateY=30, rotateZ=25.
  • I want the teapot to ignore the camera's X and Z rotation, only matching the Y rotation, so the teapot should now be rotateX=0, rotateY=30, rotateZ=0.
  • In other words, it's still standing firmly on the ground, but it has been rotated to face the camera with the Y axis only. Because real teapots won't magically ballance on the side of the handle, by 3 totally random axises, as they'd fall over then ;-).

How do I do this?

Not important, but interesting: The actual application will be for 4-vertex planes with an image on it. For example glowing beams of, lets say, 'laser swords' that always face the camera along only 1 axis to draw a proper effect. Those things just look wonky as 3d-objects and are much better off as a 4-vertex plane that faces the camera but along only 1 axis (so they still are parallel to the sword). This comes closest to an automated form of rotoscoping for me.


lesbentley ( ) posted Tue, 16 October 2012 at 7:05 AM

'Point At' works along a line from the 'origin' of the pointing object through its 'endPoint' and finishing (or starting, depending how you look at it) at the origin of the Point At target. Thus the orientation of the pointing can be set via the endPoint of the item.

None of the above seems much help with your problem. I don't know a solution to your problem off the top of my head, but I have a couple of ideas that might work. But rather than just sprouting off with ideas that might come to nought, I want to test them out first. I will get back to you when, and if, I have something interesting to report.


Ahkreeah ( ) posted Tue, 16 October 2012 at 8:07 AM

Thank you! That's really appreciated.


markschum ( ) posted Tue, 16 October 2012 at 11:16 AM

You can do it via script with the main camera I think, but you have to reun the script when you move the camera.   This is a common request for "billboards" of people and plants but has not had a simple solution as yet.

 


MistyLaraCarrara ( ) posted Tue, 16 October 2012 at 3:02 PM · edited Tue, 16 October 2012 at 3:05 PM

one trick, a lil more work. 

add a primitive as a control prop, parent the camera and the teapot to it. 
use the control prop to rotate the teapot and camera as needed,
but move the teapot only when you want it to wobble without the camera.

n/m.  didn't notice right away you wanted billboards to face the camera.

i use the control prop method for when ships tail spin, but want the camera to follow without doing the blair witch project thing  :)



♥ My Gallery Albums    ♥   My YT   ♥   Party in the CarrarArtists Forum  ♪♪ 10 years of Carrara forum ♥ My FreeStuff


lesbentley ( ) posted Tue, 16 October 2012 at 4:21 PM · edited Tue, 16 October 2012 at 4:34 PM

file_487725.TXT

In the attached zip there is a cm2 file that may be of some use. It injects slaving code into the currently selected prop or actor so that the prop's yrot channel takes input from the yaw (yOrbit) channel of the main camera.

I think the file fulfils the first three points of your "teapot" scenario. The fourth point seems to imply the rather dubious assumption that two items with the same (or inverse) yRotation will always face each other. In the case of the teapot and camera scenario this may be close enough to the truth that it does not matter. But I suspect that the more complicated case of a laser sword would soon show the fallacy. With a teapot sitting on a table, it's yAxis is always going to be in line with the world yAxis. A sword may be, and usually is, wielded in such a way that it is rotated on all three axes, and its yAxis will rarely be in line with the world yAxis. This means that it may be very far off "looking" at the camera, even when it shares the same yRotation with the camera. So although it does what you asked for in matching the yRotation of the camera, it may not do what you need in some situations. At the moment I have no solution to this more complicated scenario.

Getting back to the attached zip file. I had to add ".TXT" to the end of the name, in order to post it to this forum. You will need to loose the ".TXT" part of the file extension befor you will be able to extract the zip. After that, install it like any other poser content. You will end up with a camera file in the path:

RuntimeLibrariesCameraLesBentleyCURRENT ActorSlaveToYaw.cm2

In Poser select the prop that you want to use, and apply SlaveToYaw file. This should slave the yrot of the prop to the yaw of the Main Camera. There is also a SlaveToYawOff file included to disable the slaving.

It seems to work in PP2012 and P6, so it will probably work in everything in-between.


lesbentley ( ) posted Tue, 16 October 2012 at 4:39 PM

The forum ate the back-slashes in the path in my last post. The path should read:

 

RuntimeLibrariesCameraLesBentleyCURRENT ActorSlaveToYaw.cm2


Ahkreeah ( ) posted Tue, 16 October 2012 at 5:03 PM

Thanks! :) I'll give it a try first thing tomorrow.


JoePublic ( ) posted Tue, 16 October 2012 at 5:22 PM · edited Tue, 16 October 2012 at 5:25 PM

YAY ! Finally working billboard trees !

Making outdoor scenes just got a lot easier.

Many thanks, lesbentley.


lesbentley ( ) posted Tue, 16 October 2012 at 5:37 PM · edited Tue, 16 October 2012 at 5:44 PM

Content Advisory! This message contains nudity

file_487731.png

> Quote - YAY ! Finally working billboard trees ! > > Many thanks, lesbentley.

I imagine it will probably work fairly well for something like billboard trees, where the yAxis of the props can stay aligned with the yAxis of the camera.

When starting to investigate this problem, the first thing I tried was to delete the xrot and zrot channels from a prop, but even without the xrot and zrot channels the prop would still twist on the x and z axes when Point At was used. So there seems to be no way to limit 'Point At' to one axis.

In the image above there is an instance the same prop parented to the rHand of each figure. Each prop has had my SlaveToYaw applied to it. Each prop has a yRotation of 53°, which is the same value as the yOrbit of the Main Camera.

The yAxis of the lower prop is approximately parallel with the yAxis of the Main Camera, and thus the prop is pointing approximately towards the camera. The upper prop has had its yAxis carried far from alignment with that of the camera by virtue of being parented to the hand and being  carried up and around by rotation of the right shoulder. Both props have the same yRotation as the camera, but both props point in very different directions. This is the same sort of problem you would get with a Light-saber.

So, on the face of it, neither Point At nor ERC seem to provide an adequate solution for the Light-saber problem. I have not given up quite yet though.


Ahkreeah ( ) posted Wed, 17 October 2012 at 8:16 AM

A jury-rigged alternative I could make is giving a lightsaber prop with a beam plane a simple slider named BeamAngle which makes the plane rotate on the y-axis so that the user can drag the slider until the beam faces the camera in the best way possible. But automatic would be far nicer. :)


Privacy Notice

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.