Jump to content

Tank turret rotation, gun muzzle seat attachment thing problem


darkstylerz
 Share

You are about to reply to a thread that has been inactive for 2694 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello, I have learned a bit more about constructing stuff, but I got new problem.

https://i.imgur.com/tvGxORU.jpg

There is the red box I want to use the axis of turret to determine it's location, being positioned always in front of the gun barrel. It's own axis will be used as a seat, and that is not a problem. I kinda want it to support camera, so I can have the view coming always from the gun barrel like here:

https://i.imgur.com/CmCEbMj.png

So you kinda sit on box, and it goes with you, always pointing through reticle no matter what. Avatar is no problem, since I wrote script that hides it. It will just be lovely if you actually seen through the gun instead of coupola.

I can write quite a lot of things, but those rotation relation things make my brain melt.

Please help.

Anyone who helps receives finished product for free.

 

Thank you!

Link to comment
Share on other sites

It might be easier if you were in mouselook.  Then you could capture the camera's rotation with llGetCameraRot  and simply rotate the turret and gun to match.  Something like

grCameraRotation = llGetCameraRot();vector gvCarDirection = <1.0,0.0,0.0>*llGetRot();vector gvCameraDirection = <1.0,0.0,0.0>*grCameraRotation;rotation grTurretAxis = llRotBetween(gvCarDirection,gvCameraDirection);llSetLinkPrimitiveParamsFast (giTurretLink, [ PRIM_ROT_LOCAL,grTurretAxis]);
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2694 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...