Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banderi

Member Since 03 Mar 2013
Offline Last Active Oct 03 2013 10:14 AM

Posts I've Made

In Topic: Re: Bill-boarding oriented rectangle

01 October 2013 - 10:14 AM

@Norman

Eh, I'd love for D3D APIs, but nobody suggested there were any, so I thought there weren't and tried the direct math approach..

Now that I think of it.. did I also forget to align the quad to the axis before creating the matrices? Uhm, I've gotta check.

 

@Trienco

Well, I somewhat found symbols or quick names way easier to read and remember, but that's just the way I'm used to.

I'm sorry if I made so much confusion between the operation, I tried my best to follow what you suggested but it seems I failed.. and I still don't understand how matrices work, so is easy for me to erroneously switch vectors in cross products. xD

I'll change my code and give it a try!

 

EDIT: Ehm, by the way, I did what you said, "and after that use another cross product between the first and third vector to "fix" the second one"

The second and the third vectors are X and Y... unless your order was different from the one Kryzon was basing himself upon (X, Z, Y).

 

EDIT2: Oh? Apparently, I'd already actually got everything alright. I changed the code and the result is exactly the same.. so the error is somewhere else, and my code is equivalent to your solution, although semantically (or conventionally) incorrect? Math rules!

 

EDIT3: Yup. What was wrong is I was building the points on length (or "forward") = abs (p1.x - p2.x) instead of actually building the distance between them. What a stupid error...

Anyways, it works just fine now! Thanks a bunch you guys! ;)


In Topic: Bill-boarding oriented rectangle

24 June 2013 - 08:23 AM

Mh, I'll try this one as soon as I get my hard disk fixed (hope soon... sigh)

Thanks!


In Topic: Bill-boarding oriented rectangle

23 June 2013 - 05:52 PM

@Kryzon

Sounds exactly what I need, although the rectangle should not be aligned with any standard axis;

So, one million dollar question: how do I get it to rotate around a particular non-aligned axis (which should correspond to the distance between the points) a certain angle, such that said angle returns a bill-boarded normal (which if I got it right, should be the same formula you showed)?


In Topic: Bill-boarding oriented rectangle

23 June 2013 - 12:46 PM

..sweet Jesus, my brain exploded. Hold on a sec *picks up brain*

 

@BornToCode

This kind of bill-boarding is not what I require, and I've also achieved it through a waaaay simpler way (same rotation matrix of the camera applied on the mesh).

In other words, if I apply the matrix to a rectangular mesh, it rotates it toward the camera with the original position fixedly projected on a plane. That's not supposed to happen in my case, as the rectangle has to be a connection between two 3D points ;)

 

@Waterlimon

Not to be rude.. but I just don't get a single word.. as I said, I HORRIBLY fail at math in this point..

Could you make it simpler? If possible, can you use DirectX APIs to do that?


In Topic: Bill-boarding oriented rectangle

23 June 2013 - 10:02 AM

If the quad is the rectangle, it needs to be the distance between the points by a fixed length ("thickness"), as if I was to draw a textured stripe between them.

So yeah, it basically would need to be scaled according to their distance while maintaining its other dimension.


PARTNERS