JV ODE _ Newbie Question
Blitz3D Forums/Blitz3D Userlibs/JV ODE _ Newbie Question
| ||
I know that is not very JV ODE related, but i´m using one of their demos to build a little app with physics. I´m a newbie of Blitz3D and getting some trouble to setup my things up. In demo CarDemo-Trimesh-Capsule, the car is always in center of screen. I need the car to be position almost at botton of the screen. here an image what i pretend ![]() Thanks in advance |
| ||
Look at the Blitz3D docs for 'pivots'. You need to create a pivot and parent it to 'CMesh' (the car body), then offset the pivot on the y-axis. ; # Needs to be placed after the 'Create car body' code Global YourPivot=CreatePivot(CMesh) PositionEntity YourPivot,0,5,0 Next, point the camera at the pivot instead of the car body in the UpdateCam() function of the demo... Change... PointEntity Camera,CMesh to... PointEntity Camera,YourPivot |
| ||
Thank You very much, Vip3r. It gives me a weird camera move, but it point me to a correct solution. Thanks a lot |
| ||
Oops, the weird camera movement is because the camera pivot needs changing too... Make sure you create 'YourPivot' before the camera setup code, then... Change... Global CameraPivot=CreatePivot(CMesh) to... Global CameraPivot=CreatePivot(YourPivot) |
| ||
Hi, I did it and it is broken the visualization. |
| ||
Hmm, for some reason I thought you wanted the car slightly to the right before, I must have mis-read it. I've updated the position code above to reflect this. Here's a car demo showing the new camera position... Look for 'OffsetPivot' to view the new code. You can adjust the camera height by changing the y-axis value (currently 5) here... PositionEntity OffsetPivot,0,5,0 You can adjust the camera angle by changing the y-axis value in the UpdateCam() function... PositionEntity CameraPivot,0,-2,-12 |
| ||
Amazing! Many thanks. I studying all the codes deeply. :) All the best |
| ||
Hi Jim, I´m getting lots of progress with JV-ODE (excellent) and Blitz3D. I have stuck with one question, if you can help me: how can avoid camera penetrations in trimeshes? I put a mesh (a room) and made it a trimesh, but camera penetrates it sometimes. How can I avoid it? |
| ||
Parent the camera to a small Blitz sphere and use Blitz collision checking against the visible room mesh entity (not the TriMesh). When the sphere comes into contact with the room mesh, both it and the camera will not be able to penetrate it. You will probably find much more info about this in the Blitz3D programming forums, as it applies whether physics are used or not. |
| ||
Thanks for the guide. |
| ||
"Parent the camera to a small Blitz sphere and use Blitz collision checking against the visible room mesh entity (not the TriMesh). When the sphere comes into contact with the room mesh, both it and the camera will not be able to penetrate it." I lost my entire day in this subject. No success :((( Thanks for the help |
| ||
You need to look into 3rd person cameras, a quick search reveals these threads... http://www.blitzmax.com/Community/posts.php?topic=52890 http://www.blitzmax.com/Community/posts.php?topic=68571 If you still need help with it, post the question in the programming forums, you won't get much help on 3rd person cameras in the userlibs forum. Don't get too disheartened, some of this stuff is really hard for a beginner. |