Rotating objects around Y axis to face viewer 
Author Message
 Rotating objects around Y axis to face viewer

Hello all

I am experimenting with the 'bargraph' example, to
investigate ideas that are required for my companies
modeling product. I have a label for the height (on the Y
axis) using the CreateText method.

The 'bargraph' can be re-oriented by the mouse and the
idea is that the label is rotated so it is always facing
the viewer. My inital thought was that it was like a
billboard, but I don't believe this is the case as the
viewpoint is constant and my 'world' is rotating.

Any pointers on a good place to start.

Many thanks

Tom



Tue, 28 Sep 2004 22:34:31 GMT  
 Rotating objects around Y axis to face viewer

Quote:
> The 'bargraph' can be re-oriented by the mouse and the
> idea is that the label is rotated so it is always facing
> the viewer. My inital thought was that it was like a
> billboard, but I don't believe this is the case as the
> viewpoint is constant and my 'world' is rotating.

This still sounds like a billboarding technique.

Set a default world matrix that points your label towards the viewer.
Render the label.  Then set the matrix that you are using to render the
rotated geometry.  Render and repeat.

--
Eric DeBrosse
http://www.blown.com/dx/
Microsoft Visual Basic DirectX MVP

The opinions expressed in this message are my own personal views and
do not reflect the official views of Microsoft Corporation. The MVP program
does not constitute employment or contractual obligation with Microsoft.



Wed, 29 Sep 2004 03:28:09 GMT  
 Rotating objects around Y axis to face viewer

Quote:
>This still sounds like a billboarding technique.

>Set a default world matrix that points your label towards
the viewer.
>Render the label.  Then set the matrix that you are using
to render the
>rotated geometry.  Render and repeat.

>--
>Eric DeBrosse
>http://www.blown.com/dx/
>Microsoft Visual Basic DirectX MVP

Thanks Eric

I've now just got to get my head around converting camera<-

Quote:
>world coords so I can generate the matrix - I wish I paid

more attention in my 3D graphics course at university.

Cheers

Tom



Fri, 01 Oct 2004 15:55:43 GMT  
 Rotating objects around Y axis to face viewer

Quote:
> I've now just got to get my head around converting camera<-
> world coords so I can generate the matrix

If your view matrix is changing every frame, it might be easier to extract
some vectors from the view matrix to orient your billboard towards the
camera.  I've got a tutorial based on VB code here:

http://www.blown.com/dx/articles/billboards/

It makes a diamond shape, but you should be able to convert it to what you
want.

Quote:
> I wish I paid
> more attention in my 3D graphics course at university.

Would have been nice if my college had a 3D graphics class when I was
enrolled.

--
Eric DeBrosse
http://www.blown.com/dx/
Microsoft Visual Basic DirectX MVP

The opinions expressed in this message are my own personal views and
do not reflect the official views of Microsoft Corporation. The MVP program
does not constitute employment or contractual obligation with Microsoft.



Sat, 02 Oct 2004 01:39:15 GMT  
 Rotating objects around Y axis to face viewer

Quote:
>If your view matrix is changing every frame, it might be
easier to extract
>some vectors from the view matrix to orient your

billboard towards the
Quote:
>camera.  I've got a tutorial based on VB code here:

>http://www.blown.com/dx/articles/billboards/

>It makes a diamond shape, but you should be able to

convert it to what you
Quote:
>want.

Thanks Eric, this was my first port of call, but sadly not
app. as the view matrix doesn't change every frame.

Cheers

Tom



Sat, 02 Oct 2004 21:57:07 GMT  
 Rotating objects around Y axis to face viewer
Well ,since the view is not changing, just create a world matrix set to
identity to render your label with.  Define each of the vertices in your
label (using world coordinates) so that the orientation and size is the way
you like.  Don't be afraid to try a little experimenting.

--
Eric DeBrosse
http://www.blown.com/dx/
Microsoft Visual Basic DirectX MVP

The opinions expressed in this message are my own personal views and
do not reflect the official views of Microsoft Corporation. The MVP program
does not constitute employment or contractual obligation with Microsoft.


Quote:

> >If your view matrix is changing every frame, it might be
> easier to extract
> >some vectors from the view matrix to orient your
> billboard towards the
> >camera.  I've got a tutorial based on VB code here:

> >http://www.blown.com/dx/articles/billboards/

> >It makes a diamond shape, but you should be able to
> convert it to what you
> >want.
> Thanks Eric, this was my first port of call, but sadly not
> app. as the view matrix doesn't change every frame.

> Cheers

> Tom



Sun, 03 Oct 2004 00:02:04 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Using Mouse to Rotate around an object......

2. Rotating x-axis labels on graph

3. Rotating the 3rd axis

4. MMM-YY Date formats for Group-Axis of chart in Report Viewer

5. Rotate one pixel around another pixel...

6. How To Rotate Text Around Its Center Point

7. $$$ in Toronto for Face-To-Face with Access 7 MCP

8. $$$ in Toronto for Face-to-Face with Access 7 MCP

9. Report Object Model/Viewer Object Model

10. Viewer Object -> Report Object

11. Changing Font Size in X axis In MSChart Object

12. How do you rotate an object around an arbitrary Point?

 

 
Powered by phpBB® Forum Software