Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Blitz3D N00b. Camera positioning, relative to another (rotating) entity.  (Read 1889 times)

0 Members and 1 Guest are viewing this topic.

Dayjo

shut the fuck up donny.
Blitz3D N00b. Camera positioning, relative to an...
« on: July 13, 2006, 11:48:00 am »
  • hungry..
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3602
Hi, well i've started to kind of learn Blitz3D (haven't got around to reading any documentation yet). I've got a bit of movement going with a mesh, and a camera that is positioned slighty above and behind the mesh looking down. However, I'm wondering of a method of keeping the camera in a relative position to the mesh, even when it rotates and moves.

I started with this;

Code: [Select]
PositionEntity(camera, EntityX(mesh) + 3, EntityY(mesh) + 322, EntityZ(mesh) + 109)
RotateEntity(camera,EntityPitch(mesh) +43, EntityYaw(mesh)+173, EntityRoll(mesh)+0)

Which obviously is ok when the mesh is at it's start position (x=0,y=0,z=0) and facing forward (pitch = 0, yaw = 0, roll = 0), and also when you move forwards and backwards.. however, when you turn, the camera is required to move somehow, and my mind really isn't in a good state to work this out all by myself  :-\.

Any help here would be hot.
Logged
  • My Blog
Re: Blitz3D N00b. Camera positioning, relative t...
« Reply #1 on: July 13, 2006, 12:19:41 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Blitz3D does this automatically if you set the cameras parent to the entity and the position it :).
Logged

Dayjo

shut the fuck up donny.
Re: Blitz3D N00b. Camera positioning, relative t...
« Reply #2 on: July 13, 2006, 09:05:04 pm »
  • hungry..
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3602
Cheers, I managed to use a pivot and create a nice "following" effect thanks to Pipeweed :)
Logged
  • My Blog
Re: Blitz3D N00b. Camera positioning, relative t...
« Reply #3 on: July 13, 2006, 09:18:51 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Cheers, I managed to use a pivot and create a nice "following" effect thanks to Pipeweed :)

Try reading up on 'smart 3rd person cameras', they give a much nicer effect than a static camera.
Logged

Dayjo

shut the fuck up donny.
Re: Blitz3D N00b. Camera positioning, relative t...
« Reply #4 on: July 13, 2006, 10:23:29 pm »
  • hungry..
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3602
It is 'smart', it "moves towards", and drifts slightly, rather than being static :)
Logged
  • My Blog
Re: Blitz3D N00b. Camera positioning, relative t...
« Reply #5 on: July 13, 2006, 10:29:49 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Does it avoid collisions? Thats what I meant by smart. Sorry if I didn't explain correctly.
Logged

aab

^ Evolved from a Hobbit
Re: Blitz3D N00b. Camera positioning, relative t...
« Reply #6 on: July 13, 2006, 11:04:45 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 992
Something really nice to try and implement (involving such cameras) would be (rather than just making it a collision thingie) to make it notice when its about to collide with something, and make its speed slow down each frame until 0 such that when it does collide its not moving anymore, ie a smoothly bounded camera. You could use spheres for collision, and have a outer and inner spheres: When the outer collides, it doesnt react, but the rate of change of speed (or rate of change of speed multiplying factor) can become negative (setting it to a value such that when the inner sphere collides the speed of the camera in that direction has been reduced to 0).
..Its ALOT easier than what ive just said makes it sound.

Also, and easy and usefull (although obvious) tip: For collisions with models, when using b3d's collision, have a lower poly, untextured version of your model, and give it a better more suitable and safer collision shape.
Set the entity you want to draw to be its child, and give it an alpha of 0 (Dont HideEntity() it, or it will disable its collisions), and use the alpha'd to 0, low poly one, (Thats the parent) for collisions; Now collisions are much faster, can be more stable/reliable, and collisions to the invisible low poly mesh affect the higher poly (drawn) one because its its parent.
This also means that instead of moving the higher poly one, you move, rotate etc the invisible one.
..Come back to this when your working with that kindof thing, and when/if you know what im about to say means, youll probably agree: Put the low poly and high poly ones in a type, and make functions to set that types collision and the low polys alpha, and the parent of the high poly to be the low poly - Make things as easy and reusable as possible.


Logged




I ♥ Sol
.... I ♥ Sol ? wtf how long has that been there? >_> *rrrrrrrrar*
  • MySpace

Dayjo

shut the fuck up donny.
Re: Blitz3D N00b. Camera positioning, relative t...
« Reply #7 on: July 13, 2006, 11:10:53 pm »
  • hungry..
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3602
When I said n00b... I mean it, I've literally just started using it, so I've no idea how to do collisions and such yet :P. But when I work that out, i'll give your tips a try ;)

Thanks
Logged
  • My Blog
Re: Blitz3D N00b. Camera positioning, relative t...
« Reply #8 on: July 14, 2006, 12:14:49 am »
  • =/
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2284
Something really nice to try and implement (involving such cameras) would be (rather than just making it a collision thingie) to make it notice when its about to collide with something, and make its speed slow down each frame until 0 such that when it does collide its not moving anymore, ie a smoothly bounded camera. You could use spheres for collision, and have a outer and inner spheres: When the outer collides, it doesnt react, but the rate of change of speed (or rate of change of speed multiplying factor) can become negative (setting it to a value such that when the inner sphere collides the speed of the camera in that direction has been reduced to 0).
..Its ALOT easier than what ive just said makes it sound.

Also, and easy and usefull (although obvious) tip: For collisions with models, when using b3d's collision, have a lower poly, untextured version of your model, and give it a better more suitable and safer collision shape.
Set the entity you want to draw to be its child, and give it an alpha of 0 (Dont HideEntity() it, or it will disable its collisions), and use the alpha'd to 0, low poly one, (Thats the parent) for collisions; Now collisions are much faster, can be more stable/reliable, and collisions to the invisible low poly mesh affect the higher poly (drawn) one because its its parent.
This also means that instead of moving the higher poly one, you move, rotate etc the invisible one.
..Come back to this when your working with that kindof thing, and when/if you know what im about to say means, youll probably agree: Put the low poly and high poly ones in a type, and make functions to set that types collision and the low polys alpha, and the parent of the high poly to be the low poly - Make things as easy and reusable as possible.



Never thought of that, thank you my friend.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.06 seconds with 56 queries.