<div dir="ltr">Hi Aashish,<div><br></div><div>Thanks for your help. I followed your hint and try to get TestTexturedBackground demo running. However, I encounter the following issues:</div><div><br></div><div>In the line: rep-><span class="">setPolyData</span>(polyData), EXC_BAD_ACCESS(code=EXC_ARM_DA_ALIGN, ...) error occurs.<br>
</div><div><br></div><div>The loadData method is defined in a class ISEViewer::<span class=""> </span><span class="">public</span><span class=""> </span>vesKiwiBaseApp. It is same as the one in TestTexturedBackground: </div>








<div>







<p class="">  <span class="">void</span> loadData(<span class="">const</span> <span class="">std</span>::<span class="">string</span> &filename, <span class="">const</span> <span class="">std</span>::<span class="">string</span> &imageFilename)</p>

<p class="">  {</p>
<p class=""><span class="">    </span><span class="">this</span><span class="">-></span>unloadData<span class="">();</span>    </p>
<p class=""><span class="">    </span>vesKiwiDataLoader<span class=""> loader;</span></p>
<p class=""><span class="">    </span>vtkSmartPointer<span class=""><</span>vtkPolyData<span class="">> polyData =</span></p>
<p class="">    <span class="">vtkPolyData</span>::<span class="">SafeDownCast</span>(loader.<span class="">loadDataset</span>(filename));</p>
<p class="">    <span class="">assert</span>(polyData.<span class="">GetPointer</span>());</p>
<p class="">    </p>
<p class=""><span class="">    </span>vesKiwiPolyDataRepresentation<span class="">* rep = </span><span class="">new</span><span class=""> </span>vesKiwiPolyDataRepresentation<span class="">();</span></p>
<p class=""><span class="">    rep-></span>initializeWithShader<span class="">(</span><span class="">this</span><span class="">-></span><span class="">ShaderProgram</span><span class="">);</span></p><p class=""><span class=""><br>
</span></p><p class=""><span class="">    // Here is the EXC_BAD_ACCESS error occurs</span></p>
<p class="">    rep-><span class="">setPolyData</span>(polyData);</p>
<p class=""><span class="">    rep-></span>addSelfToRenderer<span class="">(</span><span class="">this</span><span class="">-></span>renderer<span class="">());</span></p>
<p class="">    <span class="">this</span>-><span class="">DataRep</span> = rep;</p>
<p class="">    </p>
<p class="">    <span class="">this</span>-><span class="">setBackgroundImage</span>(imageFilename);</p>
<p class="">  }</p><p class=""><br></p><p class="">The method is called in a ViewController's initViewer method:</p><p class="">-(<span class="">void</span>) initViewer</p><p class="">{</p><p class=""><span class="">  [</span><span class="">EAGLContext</span><span class=""> </span>setCurrentContext<span class="">:</span><span class="">self</span><span class="">.</span><span class="">context</span><span class="">];</span></p>
<p class="">  </p><p class=""><span class="">  </span><span class="">std</span><span class="">::</span><span class="">string</span><span class=""> model = [[[</span><span class="">NSBundle</span><span class=""> </span>mainBundle<span class="">] </span>pathForResource<span class="">:</span><span class="">@"bunny"</span><span class=""> </span>ofType<span class="">:</span><span class="">@"vtp"</span><span class="">] </span>UTF8String<span class="">];</span></p>
<p class=""><span class="">  </span><span class="">std</span><span class="">::</span><span class="">string</span><span class=""> background = [[[</span><span class="">NSBundle</span><span class=""> </span>mainBundle<span class="">] </span>pathForResource<span class="">:</span><span class="">@"kiwi_opaque"</span><span class=""> </span>ofType<span class="">:</span><span class="">@"png"</span><span class="">] </span>UTF8String<span class="">];</span></p>
<p class="">  </p><p class=""><span class="">  </span><span class="">self</span><span class="">-></span>viewer<span class=""> = </span>ISEViewer<span class="">::</span>Ptr<span class="">(</span><span class="">new</span><span class=""> </span>ISEViewer<span class="">);</span></p>
<p class="">  <span class="">self</span>-><span class="">viewer</span>-><span class="">initGL</span>();</p><p class=""><span class="">  [</span><span class="">self</span><span class=""> </span>resizeView<span class="">];</span></p>
<p class="">  </p><p class=""><span class="">  </span><span class="">self</span><span class="">-></span><span class="">viewer</span><span class="">-></span>initShader<span class="">(</span></p><p class="">                           <span class="">vesBuiltinShaders</span>::<span class="">vesShader_vert</span>(),</p>
<p class="">                           <span class="">vesBuiltinShaders</span>::<span class="">vesShader_frag</span>());</p><p class=""><br></p><p class="">  <span class="">self</span>-><span class="">viewer</span>-><span class="">loadData</span>(model, background);</p>
<p class="">  <span class="">self</span>-><span class="">viewer</span>-><span class="">resetView</span>();</p><p class="">
























</p><p class="">}</p><p class="">I am not sure what cause the issue, any help is appreciated!</p></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 17, 2014 at 8:29 AM, Aashish Chaudhary <span dir="ltr"><<a href="mailto:aashish.chaudhary@kitware.com" target="_blank">aashish.chaudhary@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Li, <div><br></div><div>Although the utility is not directly exposed, it can be done. There is an example int  the kiwi/testing to render texture as the background imagery.</div>
<div><br></div><div>If you can get the video frame as texture then you can use the code to achieve video rendering on the background. Let us know if you need help. </div>
<div><br></div><div>- Aashish</div><div> </div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Fri, Mar 14, 2014 at 3:15 PM, Li Ge <span dir="ltr"><<a href="mailto:lge@ucsd.edu" target="_blank">lge@ucsd.edu</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi all,</span><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">I am trying to integrate ves with a mobile augmented reality app. I am wondering how to render camera video background using ves. Is it possible?</div><span><font color="#888888">
<div><br></div>-- <br>Li Ge <br>Department of Structural Engineering<br>UC San Diego
</font></span></div>
<br></div></div>_______________________________________________<br>
Ves mailing list<br>
<a href="mailto:Ves@public.kitware.com" target="_blank">Ves@public.kitware.com</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/ves" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/ves</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>| Aashish Chaudhary <br>| R&D Engineer         <br>| Kitware Inc.            <br>| <a href="http://www.kitware.com" target="_blank">www.kitware.com</a>    
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Li Ge <br>Department of Structural Engineering<br>UC San Diego
</div>