Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

My scenario: RTS combat style, 1 unit fires beam on another unit

My problem is i want to draw a flat texture between 2 Vector3 points. I have looked at various Billboarding styles but that doesn't give me a proper solution.

I looked at this: http://msdn.microsoft.com/en-us/library/bb464051.aspx

is BasicEffect and DrawPrimitives the correct solution just stretch the texture to the distance between point of origin to target? I used the quad class they used but i found this it seemed to inflexible

So my question to you is how would i go about this sort of problem?

Regards

share|improve this question
add comment

1 Answer

There are some aspects of billboarding you can use, but not all of it. The beam can either be a model or you can set up a series of 4 vertices and update it each frame and use DrawPrimitives if you want.

I've done it by using a model of a Plane (4 vertices) and stretching and orienting(partial billboarding) its matrix to cause the beam to display properly.

Mostly it's about building an orthogonal matrix to transform the beam vertices properly.

Here's a video of the way I did a similar thing for someone who asked a similar question. If you want the source code, email me. http://www.screencast.com/t/LDzD2NXOZ

share|improve this answer
    
Hi, this is exactly what i want. I'm not sure how to email in Exchange but your source code would be extremely useful –  Sparky41 Nov 5 '12 at 14:53
    
I have my email in my user profile, I thought it would show publicly. It is steve (dot) hazen (at) gmail (dot) com –  Steve H Nov 6 '12 at 13:25
    
Cool i've sent you an email –  Sparky41 Nov 6 '12 at 15:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.