Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

3 Dimensional Chat / "glue" an object without the glueing part :)

Author
Message
AluminumPork
21
Years of Service
User Offline
Joined: 28th Oct 2003
Location: Duluth, MN, USA
Posted: 3rd Feb 2004 03:40
Yes, this may seem like an odd question... but I need to figure out a way to hold the top object, "the turret" to the bottom object "the tank".

Here's what I mean:

I've got 4 points around the tank to detect elevation on a matrix.
A single centered sphere which is hidden. The tank body is glue to this sphere, the sphere transfers all tilt changes to the tank.

I then (had) a turret which was glued to a centered limb on the tank. To act like a turret I would rotate this on the Y Axis. (Top down perspective). This was all good and dandy, but then I realized that for some odd reason, that when I went on to make a firing function, the bullet would fire in a way wrong direction.

The same became apparent when I used a "cursor" object for the turret to point at. As soon as I start turning or rotating the tank, everything would get way off.

This is all fixed if I can find a way to transfer all tilts and positions to an un-glued object. So when the tank tilts and drives up a hill, the turret actually looks likes it's connected.

Thanks for any help...

P4 2.4Ghz HT, 512MB RAM, ATI Radeon 9600 128MB, 19" Viewsonic, 80GB HD

Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 3rd Feb 2004 08:10
Just rotate the turret to the same angles as the other object, ie:

Rotate Object Turret, Object Angle X(Tank), Object Angle Y(Tank), Object Angle Z(Tank)

Same with position
Position Object Turret, Object Position X(Tank), Object Position Y(Tank), Object Position Z(Tank)

You'd have to offset the turret though so it's in the corret position. So maybe:

Position Object Turret, Object Position X(Tank), Object Position Y(Tank) + TurretHeight, Object Position Z(Tank)


"Computers are useless they can only give you answers."
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 3rd Feb 2004 08:47 Edited at: 3rd Feb 2004 08:47
exeat, that shouldn't work, because... imagine that the tank is tilted going up a hill. your rotation part would probably make them properly rotated, but the position code won't work. the spot for the turret would be slightly BACK from the pivot point of the tank. of course you could use trig to work this out...

but I don't see why you don't want to glue to object to a limb? then you can just use the rotate limb commands.... any particular reason you are using 2 separate models for your tank?

also a little more detail about the problem with pointing the turret would help...

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia Ti4200 AGP 8x 128MB
arras
22
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Slovakia
Posted: 4th Feb 2004 13:50
You need to use sin/cos math for that. I have done my own code for that.
Mussi
22
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 4th Feb 2004 23:37 Edited at: 4th Feb 2004 23:37
or could just use the move object up command for simplicities sake



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 6th Feb 2004 06:23
oh come on, Mussi that's for wussies

Go Go Gadget Trig!!

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia Ti4200 AGP 8x 128MB

Login to post a reply

Server time is: 2025-06-28 02:53:28
Your offset time is: 2025-06-28 02:53:28