Jump to content
Slastraf

Math / Sprites question

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 ?

Share this post


Link to post

I found this which could possibly help, but did not test it yet:

Update:

I added a post there, with my edition of the script.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

×
×
  • Create New...