Jump to content

Math / Sprites question


Slastraf
 Share

Recommended Posts

What would be the best way to make a raycast between two points visible ? It is needed for a mechanic inside the game (no debug DrawLine)

local selfpos = self.entity:GetPosition(true)
sprite:SetPosition(selfpos+(other:GetPosition(true)-selfpos)*Vec3(0.5, 0.5, 0.5))

So far I came up with this. In this case other is an entity at the second point. It will place an object in the middle of the two Points. The question is how I rotate the model (plane) that it looks toward the Camera without many lines of code, and be reasonable efficient ? And then how do I scale it so that it will have its edges at each point ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...