<div dir="ltr">Seems like an objective C error. Do you know the exact line that's causing the error? If you debug in Xcode what does it tell you? <div><br></div><div>- Aashish</div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Mar 19, 2014 at 3:18 PM, Li Ge <span dir="ltr"><<a href="mailto:lge@ucsd.edu" target="_blank">lge@ucsd.edu</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">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>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> </span><span>public</span><span> </span>vesKiwiBaseApp. It is same as the one in TestTexturedBackground: </div>
<div>
<p> <span>void</span> loadData(<span>const</span> <span>std</span>::<span>string</span> &filename, <span>const</span> <span>std</span>::<span>string</span> &imageFilename)</p>
<p> {</p>
<p><span> </span><span>this</span><span>-></span>unloadData<span>();</span> </p>
<p><span> </span>vesKiwiDataLoader<span> loader;</span></p>
<p><span> </span>vtkSmartPointer<span><</span>vtkPolyData<span>> polyData =</span></p>
<p> <span>vtkPolyData</span>::<span>SafeDownCast</span>(loader.<span>loadDataset</span>(filename));</p>
<p> <span>assert</span>(polyData.<span>GetPointer</span>());</p>
<p> </p>
<p><span> </span>vesKiwiPolyDataRepresentation<span>* rep = </span><span>new</span><span> </span>vesKiwiPolyDataRepresentation<span>();</span></p>
<p><span> rep-></span>initializeWithShader<span>(</span><span>this</span><span>-></span><span>ShaderProgram</span><span>);</span></p><p><span><br>
</span></p><p><span> // Here is the EXC_BAD_ACCESS error occurs</span></p>
<p> rep-><span>setPolyData</span>(polyData);</p>
<p><span> rep-></span>addSelfToRenderer<span>(</span><span>this</span><span>-></span>renderer<span>());</span></p>
<p> <span>this</span>-><span>DataRep</span> = rep;</p>
<p> </p>
<p> <span>this</span>-><span>setBackgroundImage</span>(imageFilename);</p>
<p> }</p><p><br></p><p>The method is called in a ViewController's initViewer method:</p><p>-(<span>void</span>) initViewer</p><p>{</p><p><span> [</span><span>EAGLContext</span><span> </span>setCurrentContext<span>:</span><span>self</span><span>.</span><span>context</span><span>];</span></p>
<p> </p><p><span> </span><span>std</span><span>::</span><span>string</span><span> model = [[[</span><span>NSBundle</span><span> </span>mainBundle<span>] </span>pathForResource<span>:</span><span>@"bunny"</span><span> </span>ofType<span>:</span><span>@"vtp"</span><span>] </span>UTF8String<span>];</span></p>
<p><span> </span><span>std</span><span>::</span><span>string</span><span> background = [[[</span><span>NSBundle</span><span> </span>mainBundle<span>] </span>pathForResource<span>:</span><span>@"kiwi_opaque"</span><span> </span>ofType<span>:</span><span>@"png"</span><span>] </span>UTF8String<span>];</span></p>
<p> </p><p><span> </span><span>self</span><span>-></span>viewer<span> = </span>ISEViewer<span>::</span>Ptr<span>(</span><span>new</span><span> </span>ISEViewer<span>);</span></p>
<p> <span>self</span>-><span>viewer</span>-><span>initGL</span>();</p><p><span> [</span><span>self</span><span> </span>resizeView<span>];</span></p>
<p> </p><p><span> </span><span>self</span><span>-></span><span>viewer</span><span>-></span>initShader<span>(</span></p><p> <span>vesBuiltinShaders</span>::<span>vesShader_vert</span>(),</p>
<p> <span>vesBuiltinShaders</span>::<span>vesShader_frag</span>());</p><p><br></p><p> <span>self</span>-><span>viewer</span>-><span>loadData</span>(model, background);</p>
<p> <span>self</span>-><span>viewer</span>-><span>resetView</span>();</p><p>
</p><p>}</p><p>I am not sure what cause the issue, any help is appreciated!</p></div></div><div class="HOEnZb"><div class="h5"><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>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><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><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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>| Aashish Chaudhary <br>| R&D Engineer <br>| Kitware Inc. <br>| <a href="http://www.kitware.com">www.kitware.com</a>
</div>