<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 01/11/2011 06:43 PM, Izaak Van Crombrugge wrote:
<blockquote
 cite="mid:AANLkTimof27WXPTWU3CNsx5b272=SLxyPNcTNFoy6uie@mail.gmail.com"
 type="cite">There is indeed no bgl.buffer(), but there is
bgl.Buffer(). (Capital letter)<br>
When I can't find useful documentation, I try to figure it out in the
console in Blender with autocomplete.<br>
&gt;&gt;import bgl<br>
&gt;&gt;bgl. (ctrl+space)<br>
And you get the whole list.<br>
  <br>
Maybe they aren't documented because they just map all these openGL
functions?<br>
  <br>
Izaak<br>
  <br>
</blockquote>
Thanks Izaak,<br>
<br>
I didn't know about the autocomplete, but it can be very helpful.<br>
<br>
Gilberto<br>
<br>
<blockquote
 cite="mid:AANLkTimof27WXPTWU3CNsx5b272=SLxyPNcTNFoy6uie@mail.gmail.com"
 type="cite">
  <div class="gmail_quote">2011/1/11 Gilberto Echeverria <span
 dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:gilberto.echeverria@laas.fr">gilberto.echeverria@laas.fr</a>&gt;</span><br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi
Benoit,<br>
    <br>
I'm trying to get the zbuffer using the OpenGL functions, but I'm<br>
running into a couple of problems.<br>
First, I did some experiments and I can get the zbuffer using<br>
bgl.glReadPixels, but specifying a section of the screen to read. How<br>
can I change this to use the image from VideoTexture instead? I thought<br>
of using the glBindBuffer method, but that doesn't seem to be<br>
implemented in bgl.<br>
    <br>
I also have the same problem with bgl.buffer(), where I get an error<br>
saying that there is no attribute called 'buffer'. It seems to be caused<br>
by lack of support for some OpenGL functions within bgl. At least they<br>
don't appear in the documentation of Blender 2.49, and for Blender 2.5 I<br>
can't even find the bgl docs.<br>
    <br>
Thanks<br>
    <font color="#888888"><br>
Gilberto<br>
    </font>
    <div>
    <div class="h5"><br>
On 01/11/2011 12:24 PM, Benoit Bolsee wrote:<br>
&gt; Hi Gilberto,<br>
&gt;<br>
&gt; The BGL module is still there in Blender 2.5. It is now called
'bgl' so<br>
&gt; you have to "import bgl" at the start of the module. The bgl
module is a<br>
&gt; wrapper around OpenGL, so you can call all OpenGL functions with
it. To<br>
&gt; get the Zbuffer, you will need to run a custom render from a camera<br>
&gt; using VideoTexture and then you can retrieve the Zbuffer using the<br>
&gt; appropriate OpenGL function.<br>
&gt;<br>
&gt; Void pointer parameters in OpenGL map to buffer objects that you
create<br>
&gt; with bgl.buffer() method.<br>
&gt; Unfortunately, the buffer objects returned by bgl.buffer() do not<br>
&gt; support the buffer protocol, which means that you cannot export the<br>
&gt; internal memory buffer to a C module. You can however access
individual<br>
&gt; elements of the buffer from python using sequence methods.<br>
&gt; Adding support for the buffer protocol to bgl.buffer object type<br>
&gt; shouldn't be difficult though.<br>
&gt;<br>
&gt; Hope this helps,<br>
&gt; Benoit<br>
&gt;<br>
&gt;<br>
&gt;&gt; -----Original Message-----<br>
&gt;&gt; From: <a moz-do-not-send="true"
 href="mailto:robotics-bounces@blender.org">robotics-bounces@blender.org</a><br>
&gt;&gt; [mailto:<a moz-do-not-send="true"
 href="mailto:robotics-bounces@blender.org">robotics-bounces@blender.org</a>]
On Behalf Of Gilberto Echeverria<br>
&gt;&gt; Sent: mardi 11 janvier 2011 10:07<br>
&gt;&gt; To: Blender and Robotics<br>
&gt;&gt; Subject: [Robotics] Depth information from a camera<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hello everyone,<br>
&gt;&gt;<br>
&gt;&gt; For the MORSE simulator, we are trying to recreate laser<br>
&gt;&gt; range scanners,<br>
&gt;&gt; that provide depth information from a sensor on a robot. We are<br>
&gt;&gt; currently doing this using ray tracing, but if we want to
simulate<br>
&gt;&gt; sensor with a lot of lasers, I fear ray tracing all of them<br>
&gt;&gt; will be too<br>
&gt;&gt; slow.<br>
&gt;&gt; So my question is: Is there a way to get the depth information
of a<br>
&gt;&gt; scene in a faster way? We need something that can be used<br>
&gt;&gt; from the Game<br>
&gt;&gt; Engine of Blender 2.5<br>
&gt;&gt; One possible method is to get the z-buffer from a camera.
Apparently<br>
&gt;&gt; this was possible in Blender 2.49, using the BGL modules, but<br>
&gt;&gt; that seems<br>
&gt;&gt; to have disappeared from Blender 2.5.<br>
&gt;&gt;<br>
&gt;&gt; Any ideas will be greatly appreciated.<br>
&gt;&gt; Cheers<br>
&gt;&gt;<br>
&gt;&gt; Gilberto<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Robotics mailing list<br>
&gt;&gt; <a moz-do-not-send="true" href="mailto:Robotics@blender.org">Robotics@blender.org</a><br>
&gt;&gt; <a moz-do-not-send="true"
 href="http://lists.blender.org/mailman/listinfo/robo" target="_blank">http://lists.blender.org/mailman/listinfo/robo</a>&gt;
&nbsp;tics<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Robotics mailing list<br>
&gt; <a moz-do-not-send="true" href="mailto:Robotics@blender.org">Robotics@blender.org</a><br>
&gt; <a moz-do-not-send="true"
 href="http://lists.blender.org/mailman/listinfo/robotics"
 target="_blank">http://lists.blender.org/mailman/listinfo/robotics</a><br>
&gt;<br>
    <br>
_______________________________________________<br>
Robotics mailing list<br>
    <a moz-do-not-send="true" href="mailto:Robotics@blender.org">Robotics@blender.org</a><br>
    <a moz-do-not-send="true"
 href="http://lists.blender.org/mailman/listinfo/robotics"
 target="_blank">http://lists.blender.org/mailman/listinfo/robotics</a><br>
    </div>
    </div>
  </blockquote>
  </div>
  <br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Robotics mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Robotics@blender.org">Robotics@blender.org</a>
<a class="moz-txt-link-freetext" href="http://lists.blender.org/mailman/listinfo/robotics">http://lists.blender.org/mailman/listinfo/robotics</a>
  </pre>
</blockquote>
<br>
</body>
</html>