I realized my original reply didn't reach the clutter mailinglist since
I sent it from the wrong address...

On Fri, 2009-07-17 at 23:12 +0200, Filipe Nepomuceno wrote:
> On Fri, Jul 17, 2009 at 11:24 AM, Neil Roberts<[email protected]> wrote:
> > On Fri, 2009-07-17 at 10:39 +0200, Filipe Nepomuceno wrote:
> >
> >> I am trying to connect actors in a graph with a single line in 3D and
> >> was wondering what would be the best way to go about this.
> >>
> >> I was thinking of creating a rectangle of width=2 and height=distance
> >> between actors, and then use trig to rotate it into place. This is a
> >> very expensive solution though (if it works) because of the trig
> >> function calls and it wont show a line if it is rotated 90 degrees
> >> around the x axis.
> >>
> >> Another idea I had was to create a custom actor and use opengl calls
> >> to just draw a line. with glVertex.
> >
> > You can also use the Cogl path API to draw a line. This should be easier
> > than using GL directly because otherwise you have to be careful not to
> > conflict with Cogl's state caching of GL. So something like:
> >
> > cogl_path_move_to(actor_x, actor_y);
> > cogl_path_line_to(other_actor_x, other_actor_y);
> > cogl_path_stroke();
> >
> > - Neil
> >
> >
> 
> Hi,
> 
> That solution works if all the actors are on one plane but how can I
> extend that to actors that are at a different depth? Or am I missing
> something?

Another option is the cogl vertex buffer API. You can find more details
about this API here:
http://www.clutter-project.org/docs/cogl/0.9/cogl-Vertex-Buffers.html
(or please check my recent reply to the mailinglist question: "[clutter]
Using COGL for 3D drawing")

The cogl_polygon API also allows you to give z coordinates to vertices
so that may be a simpler option.

regards,
- Robert

-- 
Robert Bragg, Intel Open Source Technology Center

-- 
To unsubscribe send a mail to [email protected]

Reply via email to