Rent a coder: camera routine

Blitz3D Forums/Blitz3D Programming/Rent a coder: camera routine

Al Meyer(Posted 2008) [#1]
I don´t know if here is the right place for it, but, I´m prototyping a very small game using JV-ODE. Everything is fine with physics, etc, but I need a camera routine that a can use a "mario" type of camera that do not penetrates the walls behind it. The problem is I have a room and my car goes backwards, camera penetrates the wall. Í can pay US$ 15 for a very simple routine that to not allow it. I can pay via Paypal. Not need very sofisticaded, but works. Thanks


Ross C(Posted 2008) [#2]
Don't bother paying people money :o)

Set up your camera and give it an entity type. This way, it will collide with the walls, and not go through it.


Stevie G(Posted 2008) [#3]
Yes Ross but that won't work in most situations. You need some form of smart cam that always finds a point where it can see the player. I'm in the process of writing something for my own purposes, if it works out I'll post the code here.


Al Meyer(Posted 2008) [#4]
I bought the ODE lib for about 30$ and i think it´s fair pay US$ 15 for a small routine. I really need it and have tried without success. It´s usually a fee for a small routine in rent-a-coder. I know that is small money, but, it´s only a function, if someone has it. My e-mail is tmedia@...

Thanks


GfK(Posted 2008) [#5]
When the car is going backwards, why not move the camera in front of it so you can still see where you're going?

(is it me, or is the reply box bigger than it used to be??)


Al Meyer(Posted 2008) [#6]
I´m planning a game using a car like a mars rover, so i need to see it going backwards from my camera view, and avoid penetrate on the walls behind.


Ross C(Posted 2008) [#7]
Yeah i know :o) I just thought i'd make the point that it's probably something that someone on here could do.

I was thinking about this too, using a cylinder pointing from the camera position to the entity your following, or something to determione line of sight. I also though of having waypoints for the camera, in crowded areas, automatically generated, and the camera could go from waypoint to waypoint. I think it would be pretty processor intense to calculate properly the best view, because of the shear number of different views.

Interesting topic though. I'm sure stevie will find a way though!


John Pickford(Posted 2008) [#8]
>I bought the ODE lib for about 30$ and i think it´s fair pay US$ 15 for a
>small routine.

ODE wasn't written specifically for you. You can't seriously expect bespoke coding for that kind of price.


Uncle(Posted 2008) [#9]
What about this from the code archives...

http://www.blitzbasic.com/codearcs/codearcs.php?code=1083

Haven't tested it but it says on the tin that is avoids collisions with meshes.


Moraldi(Posted 2008) [#10]
I'm in the process of writing something for my own purposes, if it works out I'll post the code here.

I'll have my eyes on it


Al Meyer(Posted 2008) [#11]
"ODE wasn't written specifically for you. You can't seriously expect bespoke coding for that kind of price."

Mr Pickford, of course I know it. JV-ODE is a excellent tool. I´m just asking for someone could help me and get some $ for the time. Of course I have looked over the code archive and I not found a solution. There´s no need to avoid all the geo, just the walls of a room.

I have Blitz3D for years, but I do not use it. This month, i decide to use it and studying everything, but I´m stuck in some theories, because I´m a Delphi coder and the language is different. I have bought many libs these days, even i don´t need them, just for support the authors. I know very much how much is difficult learn something from scratch. Sorry for my bad english.

I really need this routine. Cheers


Naughty Alien(Posted 2008) [#12]
this example do what you want..set it up for your own purpose..it cant be more simple..

Type CSys

Field cx#, cy#, cz#
Field mx#, my#, sps%

End Type

Function ChaseCam(cam, Entity, XOff#, YOff# = 2, ZOff# = -5, Spd# = 0.8)

Local sys.csys = First csys
Local nx#, ny#, nz#
Local dx#, dy#, dz#
Local ex#, ey#, ez#
Local hit%

If sys = Null
sys = New cSys
sys\sps = CreatePivot()
EndIf

sys\mx = MouseX()
sys\my = MouseY()
sps = sys\sps
PositionEntity sps, EntityX(entity), EntityY(entity), EntityZ(entity)
TFormVector xOff, yOff, zOff, entity, 0
ex# = EntityX(entity)
ey# = EntityY(entity)
ez# = EntityZ(entity)
nx# = ex+TFormedX()
ny# = ey+TFormedY()
nz# = ez+TFormedZ()
dx# = nx-ex
dy# = ny-ey
dz# = nz-ez
hit = LinePick(ex, ey, ez, dx, dy, dz, 0.2)

If hit
nx = PickedX()
ny = PickedY()
nz = PickedZ()
EndIf

sys\cx = sys\cx+(nx-sys\cx)*spd
sys\cy = sys\cy+(ny-sys\cy)*spd
sys\cz = sys\cz+(nz-sys\cz)*Spd

PositionEntity cam, sys\cx, sys\cy, sys\cz
PointEntity Cam, Entity, 0

End Function


Graphics3D 800, 600, 0, 2
SetBuffer BackBuffer()

Global cube = CreateCube()
Global cam = CreateCamera()
Global ops = CreateCube()
ScaleEntity ops, 10, 10, 1
MoveEntity ops, 0, 0, -5
EntityPickMode ops, 2

While Not KeyHit(1)

Cls

ChaseCam(cam, cube, 0, 2, -20, .1)

MoveEntity ops, KeyDown(205) - KeyDown(203), 0, 0

UpdateWorld
RenderWorld

Flip

Wend


Moraldi(Posted 2008) [#13]
@Al Meyer: If you need a ready to use solution to add some motion effects on objects (including camera's) check my lib. It is not expensive and maybe covers your needs.
You can read all the documentation and and the code of some examples (you can run them also) without buying.


Al Meyer(Posted 2008) [#14]
Naughty Alien, thanks a lot. I will test it today!

Moraldi, I just bought it.


Moraldi(Posted 2008) [#15]
Thank you Al Meyer. I Hope this library is useful to you.


Al Meyer(Posted 2008) [#16]
Naughty Alien, I have test it. I realize that it was a routine that i was found yesterday. It is really good, but not works with my level. I think i will change my level in a way to prevent the rover cames close to a wall and use Moraldi chase cam routines. Thanks


John Pickford(Posted 2008) [#17]
>Mr Pickford, of course I know it. JV-ODE is a excellent tool. I´m just asking for someone could help me and get some $ for the time.

You're the one who made the comparison.


SabataRH(Posted 2008) [#18]
The Castle demo that comes with blit3d is the best looking 'mario' style camera setup I've seen done in blitz. It dosent matter if your using a physics lib, your not going to be applying physics to the camera pivots anyways. Check out the castle demo.