| We hope you enjoy your visit. You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you are already a member please log in to your account to access all of our features: |
| Vector help | |
|---|---|
| Tweet Topic Started: May 28 2009, 04:17 PM (330 Views) | |
| Sothh | May 28 2009, 04:17 PM Post #1 |
|
Shaman Of Time
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I am trying to lean vetors so I can make the camera set in the front seat of an airplane and rotate correctly. Could some one give me the codes to do this, or point me in the right direction? Thanks. |
|
“You can’t outrun Death forever. But you can make the Bastard work for it.” Major Korgo Korgar “Last of The Lancers” - AFC 32 (Andromeda Ascendant Record Database) | |
![]() |
|
| MysteriXYZ | May 28 2009, 05:20 PM Post #2 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
You'll need something better than vectors if you want to keep the camera aligned to the seat - welcome to the matrix .That matrix should describe the position and orientation of the camera, relative to the plane model (or seat model). Then you transform that matrix with the built-in matrix of that model, and the resulting matrix will describe the desired camera position and orientation. Apply it to the camera and that's it. In camera Step Event:
Note that where you normally work with rotx/roty/rotz directly to set the orientation of the camera (for example when using the mouse to look around), you will now have to use some other variables (like rotx_rel/roty_rel/rotz_rel) instead, because you're not setting the absolute orientation, but the one relative to the plane model. I hope I pointed you and your camera in the right direction .
|
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| Sothh | May 28 2009, 05:32 PM Post #3 |
|
Shaman Of Time
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Thank you SO much. I tried it and it works fine to keep the camera in the center of the plane. Now, what would I change to off set the camera to the side? THANKS!!! |
|
“You can’t outrun Death forever. But you can make the Bastard work for it.” Major Korgo Korgar “Last of The Lancers” - AFC 32 (Andromeda Ascendant Record Database) | |
![]() |
|
| MysteriXYZ | May 28 2009, 05:46 PM Post #4 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
That would be the "x_offs" variable in my code. Just experiment, or use your modelling program of choice to get the best value. Remember, these offsets are relative to the origin of the model, so you have to know where that is first. EDIT: if that doesn't change anything, you might have to set a different value for y_offs or z_offs instead, depending on the default orientation of the plane model. Edited by MysteriXYZ, May 28 2009, 05:52 PM.
|
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| Sothh | May 28 2009, 06:00 PM Post #5 |
|
Shaman Of Time
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Thanks, it works like a charm. I am just having one problem, when I go faster I move farther back, and when I slow down I go father forward. |
|
“You can’t outrun Death forever. But you can make the Bastard work for it.” Major Korgo Korgar “Last of The Lancers” - AFC 32 (Andromeda Ascendant Record Database) | |
![]() |
|
| Atarian | May 28 2009, 06:31 PM Post #6 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
make the camera code in the end-step event, most likely you are setting the camera then moving. At least thats what i think |
![]() |
|
| MysteriXYZ | May 28 2009, 06:38 PM Post #7 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
This could again be due to the default orientation of the plane; try turning it in your modelling program so it ends up pointing in the direction of the positive Y-axis (in your U3D scene). Alternatively, add 180 to roty_rel, or simply negate the speed. |
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| Eansis | May 29 2009, 07:56 PM Post #8 |
|
ghost
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
MysteriXYZ is right, but there is an easier way. Simply add a joint to your model and set the camera to the position and rotation of the bone. That way you can precisely see the location of the player's eyes, in your model viewer. |
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY
| |
![]() |
|
| « Previous Topic · Questions about Ultimate 3D · Next Topic » |





![]](http://z1.ifrm.com/static/1/pip_r.png)



.
.
10:18 AM Jul 11