Jump to content

Search the Community

Showing results for tags 'need math help!'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 1 result

  1. Hello! I really need some math experts' help, I can't figure out what should I do. I am using the dxDrawMaterialLine3D function to draw light shadows on the ground, and these are attached to a vehicle. My only problem is that I don't know how should I make the light always face up, even when the vehicle is rotated and keep the rotation, so I won't experience problems like this: So as you can see, when I'm not on an even surface, the "light" goes through the ground, that's why I would like to make the image face upwards depending on the vehicle's rotation, or at least adjust it and not make it face always up. I hope you understand what I am trying to do. Here's what it should look like (it is on an even surface): So, I don't really know how should I calculate these numbers to make it work with the faceTowardX, faceTowardY and faceTowardZ parameters. Could somebody help me out with the calculations? local x, y, z = getElementPosition(matching.element) local rx, ry, rz = getElementRotation(matching.element) local faceX, faceY, faceZ = --?, ?, ? dxDrawMaterialLine3D(worldX, worldY-1, fixedGroundPosition, worldX, worldY+1, fixedGroundPosition, data.renderTarget, 2, tocolor(lightColor[1],lightColor[2],lightColor[3],lightColor[4]), faceX, faceY, faceZ) Thank you for your reply in advance!
×
×
  • Create New...