Need a Better Camera than ParentEntity(player)!!!
Blitz3D Forums/Blitz3D Beginners Area/Need a Better Camera than ParentEntity(player)!!!
| ||
I want my camera to be a little better than ParentEntity. The player will fly around and I need want the camera to not only point at the back, but I want it to slightly show the sides of the ship and the top or bottom if your going to up or down. If you've played Ace Combat or probably any other flight game, you know what I mean. I don't know how easy or hard this will be, but, anyone know what I mean and how to do it? |
| ||
Easy peasy man :o) Have a pivot parented to the craft (camera_pivot). Move it to the location you want the camera to be. Then, each frame do: PointEntity camera, camera_pivot MoveEntity camera,0,0,EntityDistance(camera,camera_pivot)/30 PointEntity camera,craft Smooth camera :o) So you code would look something like: Global camera = CreateCamera() Global craft = loadmesh("craft.b3d") global camera_pivot = createpivot() entityparent camera_pivot,craft moveentity camera_pivot,0,0,-10 ; or whatever distance you want the camera to be at while not keyhit(1) PointEntity camera, camera_pivot MoveEntity camera,0,0,EntityDistance(camera,camera_pivot)/30 PointEntity camera,craft updateworld renderworld flip wend |
| ||
Thanks, I don't understand how it works, but I managed to fit it into my code. I have one problem though. It's hard to explain. Ya know how in games, usually if you don't turn the plane or ship or whatever, it turns back to horizontal? Right now, the ship flips all around and goes upside down and stuff. I could probably figure it out myself, but anyone know what to do? |
| ||
Is your camera working the way you want? |
| ||
My camera is working the way I want, but the ship flips over sometimes, and the controls and theship is reverse. |
| ||
Okay, I fixed it. Nevermind. Thanks!!!! |
| ||
Okay, I decided to use this airplane from one of the demo's that came with blitz, but when you use it, it moves as if the side of it were the front. It's a .x file and I don't have anything except mesh viewer to open it so I can't turn it around. I tried rotating the plane and the camera, but it just ends up the same once you start moving. Can anyone either 1. tell me a program I can use to open and turn around a .x mesh? or how to turn it around without the camera following it? |
| ||
mesh = Loadmesh("mesh.x") RotateMesh mesh, 0, 90, 0 |
| ||
oh, cool :) lol. I need to read the whole Command Reference |
| ||
The mesh commands perminatly alter the actual mesh. The way the entity structure is structure is sort of like a Type Object.Type Entity Field Mesh Field X_Entity_Rot Field y_Entity_Rot Field z_Entity_Rot End type The mesh is a child so to speak of the entity. When you use entity commands, the parent entity (think of it as a pivot), is rotated, moved scaled... etc etc |