Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Object follow camera

Anonymous

Object follow camera

Anonymous
Not applicable

 Hi Guys,

Is there any possibility to create a object, and make this object follow the movement of the default perspective camera?

 

eg, a cross object always at the middle of the viewport, and i can click it as a touchsensor.

0 Likes
Reply
1,328 Views
9 Replies
Replies (9)

michael_nikelsky
Autodesk
Autodesk

As of VRED 2017 SR1 you can just put it as a child of the camera. Not sure if this works with previous versions though.



Michael Nikelsky
Sr. Principal Engineer
0 Likes

Anonymous
Not applicable

Hi, You mean SP1? I tried, but this doesn`t work.

0 Likes

michael_nikelsky
Autodesk
Autodesk

I mean 2017 SR1 (Subscription Release), not SP1.



Michael Nikelsky
Sr. Principal Engineer
0 Likes

Anonymous
Not applicable

OK, thanks. But unfortunately, my client is still using VRED 2015, is there any way to do this?

0 Likes

Anonymous
Not applicable

Hello Everyone...

 

This subject is so close from my question... so I prefer to post it here than into a new post.

 

Based ont the "Camera-fixed-object2.py" exemple in Vred 2017.0.2 Update, I'm trying to make some little changes into the script.

 

In fact I would like to have a Plane, always in the center of the world, always looking at the camera.

 

Is this possible to do so?

 

How to fixe the position of the plane, and to define a rotation axis for it?

I'm kind of a newbie in scripting, so a little help will be welcome.

 

Thank tou for your answers

0 Likes

dlincol1
Advocate
Advocate

Yes, create a Billboard node and attach a Plane to it.

A Billboard node will always face the camera.

 

You may need to rotate it 90 degrees depending on what axis is up in your scene.

 

Regards,

Dan

 

Regards,
Dan
0 Likes

Anonymous
Not applicable

Hi Dan, 

 

Thank you for your answer, it works great... but it is not enought for my project, in fact with a Billboard Node, the plane is always looking to the camera, but it is not rotating depending of the camera position on the Z axis...

 

If my Camera is under the plane, the plane is rotating only on the Z axis.... and I would like it to rotate on the two other axis too, depending of my camera position on the Z axis.

 

Am i clear enought?

0 Likes

dlincol1
Advocate
Advocate

Ok, based on the example script, this is a way to do it.

Using a "Plane" as the obj

 

camera_matrix = self.camera_node.getWorldTransform()

camera_matrix[3] = 0

camera_matrix[7] = 0

camera_matrix[11] = 0

self.camera_transform.setTransformMatrix(camera_matrix, false)

 

obj = findNode("Plane");

obj.makeTransform()

Regards,
Dan

Anonymous
Not applicable

Thanks a lot!

 

I also have a problem: Can we make the billboard or anything else always visible in the scene?  Just like setOculusRiftPerformanceHUD(1) or the Transform Manipulator axis.

0 Likes