<!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>
>>import bgl<br>
>>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"><<a moz-do-not-send="true"
href="mailto:gilberto.echeverria@laas.fr">gilberto.echeverria@laas.fr</a>></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>
> Hi Gilberto,<br>
><br>
> The BGL module is still there in Blender 2.5. It is now called
'bgl' so<br>
> you have to "import bgl" at the start of the module. The bgl
module is a<br>
> wrapper around OpenGL, so you can call all OpenGL functions with
it. To<br>
> get the Zbuffer, you will need to run a custom render from a camera<br>
> using VideoTexture and then you can retrieve the Zbuffer using the<br>
> appropriate OpenGL function.<br>
><br>
> Void pointer parameters in OpenGL map to buffer objects that you
create<br>
> with bgl.buffer() method.<br>
> Unfortunately, the buffer objects returned by bgl.buffer() do not<br>
> support the buffer protocol, which means that you cannot export the<br>
> internal memory buffer to a C module. You can however access
individual<br>
> elements of the buffer from python using sequence methods.<br>
> Adding support for the buffer protocol to bgl.buffer object type<br>
> shouldn't be difficult though.<br>
><br>
> Hope this helps,<br>
> Benoit<br>
><br>
><br>
>> -----Original Message-----<br>
>> From: <a moz-do-not-send="true"
href="mailto:robotics-bounces@blender.org">robotics-bounces@blender.org</a><br>
>> [mailto:<a moz-do-not-send="true"
href="mailto:robotics-bounces@blender.org">robotics-bounces@blender.org</a>]
On Behalf Of Gilberto Echeverria<br>
>> Sent: mardi 11 janvier 2011 10:07<br>
>> To: Blender and Robotics<br>
>> Subject: [Robotics] Depth information from a camera<br>
>><br>
>><br>
>> Hello everyone,<br>
>><br>
>> For the MORSE simulator, we are trying to recreate laser<br>
>> range scanners,<br>
>> that provide depth information from a sensor on a robot. We are<br>
>> currently doing this using ray tracing, but if we want to
simulate<br>
>> sensor with a lot of lasers, I fear ray tracing all of them<br>
>> will be too<br>
>> slow.<br>
>> So my question is: Is there a way to get the depth information
of a<br>
>> scene in a faster way? We need something that can be used<br>
>> from the Game<br>
>> Engine of Blender 2.5<br>
>> One possible method is to get the z-buffer from a camera.
Apparently<br>
>> this was possible in Blender 2.49, using the BGL modules, but<br>
>> that seems<br>
>> to have disappeared from Blender 2.5.<br>
>><br>
>> Any ideas will be greatly appreciated.<br>
>> Cheers<br>
>><br>
>> Gilberto<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/robo" target="_blank">http://lists.blender.org/mailman/listinfo/robo</a>>
tics<br>
>><br>
>><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>
><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>