JV ODE _ Newbie Question

Blitz3D Forums/Blitz3D Userlibs/JV ODE _ Newbie Question

Al Meyer(Posted 2008) [#1]
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


VIP3R(Posted 2008) [#2]
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


Al Meyer(Posted 2008) [#3]
Thank You very much, Vip3r. It gives me a weird camera move, but it point me to a correct solution. Thanks a lot


VIP3R(Posted 2008) [#4]
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)


Al Meyer(Posted 2008) [#5]
Hi, I did it and it is broken the visualization.


VIP3R(Posted 2008) [#6]
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


Al Meyer(Posted 2008) [#7]
Amazing! Many thanks. I studying all the codes deeply. :) All the best


Al Meyer(Posted 2008) [#8]
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?


VIP3R(Posted 2008) [#9]
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.


Al Meyer(Posted 2008) [#10]
Thanks for the guide.


Al Meyer(Posted 2008) [#11]
"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


VIP3R(Posted 2008) [#12]
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.