3D Person Camera??? I need Help!!

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.
SenVa
Posts: 38
Joined: Fri Oct 14, 2005 1:00 pm
Location: Mi

Post by SenVa »

No I meant naked time.

I made that mistake on a German test and my teacher was more then happy to share my inability to spell to the class.
Nikolino

Post by Nikolino »

Thx to all,
My problem is not solved, but it's not a problem!

thx again for your help!

I wish you all a Merry Christmas and a Happy New Year. :D
SenVa
Posts: 38
Joined: Fri Oct 14, 2005 1:00 pm
Location: Mi

Post by SenVa »

sorry we couldnt be more helpful.
Guest

Post by Guest »

Anonymous wrote:A pity you are not as fluent in the language of C++ as you are in that stuff :)
No, skipping all "," "." "!" "-" characters may result in compiler errors! ;D

Nikolino,
mit dem Code von krama757 musst du eigentlich nur eines machen:

rotationToCamera = vRotation.Y - 180;

vRotation.Y ist (wenn ich das richtig verstehe, beschäftige mich erst seit 2 Tagen mit irrlicht) der Wert, mit dem dein Charakter gedreht ist. (Also das Model). Du könntest hier zum Beispiel auch nehmen:

rotationToCamera = myModel->getRotation().Y - 180;
(oder müsste das in C "myModel.getRotation().Y" sein?)


Bei "DISTANCE_TO_CAMERA" setzt du einen Wert ein. Um so größer der Wert, um so weiter ist die Kamera vom Model entfernt.

Den Rest der Funktion kannst du so stehen lassen. Natürlich solltest du den Namen der Funktion ändern, weil du in C wohl ohne Klassen arbeitest. nehmen wir mal an, du würdest sie "getCameraPosition()" nennen. Dann kannst du nun so etwas machen:

Code: Select all

vector3df cameraPos;
cameraPos = getCameraPosition();
myCamera->setPosition(cameraPos);
myCamera->setTarget(myModel->getPosition());
Die Funktion berechnet dir die Position direkt hinter dem Model, welche du per setPosition dann an die Kamera weitergibst, und anschließend legst du das Ziel der Kamera noch auf die Position des Models fest.



Wie gesagt, ich selbst beschäftigt mich noch nicht so lange mit irrlicht und c/c++ allgemein, könnten also viele Fehler enthalten sein. ;P

hope this helps. :)
Post Reply