If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
gd_anon
Posts: 98 Joined: Sun Nov 30, 2008 11:03 am
Location: Nowhere
Post
by gd_anon » Fri Oct 02, 2009 7:49 am
Can you set a mesh as target for (Maya) camera instead of a 3d point?
Bear_130278
Posts: 237 Joined: Mon Jan 16, 2006 1:18 pm
Location: Odessa,Russian Federation
Post
by Bear_130278 » Fri Oct 02, 2009 8:05 am
Witch point of mesh??
The mesh could be just about anything
))
Do you like VODKA???
gd_anon
Posts: 98 Joined: Sun Nov 30, 2008 11:03 am
Location: Nowhere
Post
by gd_anon » Fri Oct 02, 2009 8:15 am
I mean make the maya camera's target the center of a 3d object instead of a point in 3d space (vector3df)
PS. Sorry for the confusion (and noobyness)
randomMesh
Posts: 1186 Joined: Fri Dec 29, 2006 12:04 am
Post
by randomMesh » Fri Oct 02, 2009 10:57 am
If you mean an ISceneNode by Mesh, you could use
Code: Select all
camera->setTarget(node->getAbsolutePosition());
"Whoops..."
DtD
Posts: 264 Joined: Mon Aug 11, 2008 7:05 am
Location: Kansas
Contact:
Post
by DtD » Fri Oct 02, 2009 12:04 pm
Or if you just want the Maya camera to follow the mesh around, you can probably parent the camera to the node.
~DtD
gd_anon
Posts: 98 Joined: Sun Nov 30, 2008 11:03 am
Location: Nowhere
Post
by gd_anon » Fri Oct 02, 2009 12:37 pm
If i do that wont the camera's rotation get locked?
And thanks RandomMesh, but yeah if i move the mesh the camera doesnt move with it.
Last edited by
gd_anon on Fri Oct 02, 2009 3:51 pm, edited 1 time in total.
bitplane
Admin
Posts: 3204 Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:
Post
by bitplane » Fri Oct 02, 2009 1:39 pm
You need to call that function each loop. A better option would be to make an animator which causes the camera to track an object
gd_anon
Posts: 98 Joined: Sun Nov 30, 2008 11:03 am
Location: Nowhere
Post
by gd_anon » Fri Oct 02, 2009 2:18 pm
bitplane wrote: You need to call that function each loop.
Where is that?
(im using the movement code from Irrlicht example 4)
Geomaster
Posts: 71 Joined: Tue Oct 21, 2008 3:39 pm
Post
by Geomaster » Fri Oct 02, 2009 3:32 pm
It's between 'while (device->run())' and 'videodr->beginScene();'.
gd_anon
Posts: 98 Joined: Sun Nov 30, 2008 11:03 am
Location: Nowhere
Post
by gd_anon » Fri Oct 02, 2009 3:41 pm
You mean put Camera->setTarget(node->getAbsolutePosition(); between
while(device->run()) and driver->beginScene?
Ive tried that. When i move the object, camera stays (im using movement code from Example 4 like i said)
CuteAlien
Admin
Posts: 9937 Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:
Post
by CuteAlien » Fri Oct 02, 2009 4:28 pm
Hm, not sure if that works for maya camera. The point of the maya-cam is that it is user-controlled, so it will probably override any targets you set. Maybe doing an updateAbsolutePosition() after setting it would help, but I haven't tried.
gd_anon
Posts: 98 Joined: Sun Nov 30, 2008 11:03 am
Location: Nowhere
Post
by gd_anon » Fri Oct 02, 2009 5:33 pm
It didnt work, too bad. Cause than i would have a 3rd person camera the style i want (rotate it along your character manually).
Edit. Okay ill make a custom one.