<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — set pan and tilt to match camera rotation]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2083&amp;type=atom" />
	<updated>2023-01-19T01:18:41Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=2083</id>
		<entry>
			<title type="html"><![CDATA[Re: set pan and tilt to match camera rotation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8834#p8834" />
			<content type="html"><![CDATA[<p>I think im all set its working now thanks for the help</p>]]></content>
			<author>
				<name><![CDATA[Tree2]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2374</uri>
			</author>
			<updated>2023-01-19T01:18:41Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8834#p8834</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: set pan and tilt to match camera rotation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8833#p8833" />
			<content type="html"><![CDATA[<p>If this is a question or a description of a problem, then I unfortunately did not understand it.<br />Try to rephrase it. And a little video showing the problem, I think will help a lot here.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2023-01-18T23:27:48Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8833#p8833</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: set pan and tilt to match camera rotation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8832#p8832" />
			<content type="html"><![CDATA[<p>thanks! that did it. Honestly I&#039;m not even sure how it works but it does haha.</p><p>instead of physics ray i did this which I assume is the same logic and seems to work so far.</p><p>&nbsp; &nbsp; &nbsp; &nbsp;</p><div class="codebox"><pre><code>            float pan;
            float tilt;
            Vector3 pos =cam.transform.position + cam.transform.forward * panoRenderer.radius;
            panoRenderer.GetPanTiltByWorldPosition(pos, out pan, out tilt);
            panoRenderer.pano.pan = pan;
            panoRenderer.pano.tilt = tilt;</code></pre></div><p>&nbsp; &nbsp; &nbsp; &nbsp; <br />I set this up a few weeks back and had to do some translation of the rotations based on the master file text that it came with. Its all working now but something happens with that translation when I go around a corner the North must change or something where I would end up &quot;jumping&quot; a bit when panning with the mouse because although my camera angle didn&#039;t change the pan/tilt values do. so when i go to drag view it jumps at first</p><p>sorry long description but anyway if I call this method and reset the pan/tilt to match the camera angle each time that seems to be good.</p>]]></content>
			<author>
				<name><![CDATA[Tree2]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2374</uri>
			</author>
			<updated>2023-01-18T21:42:40Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8832#p8832</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: set pan and tilt to match camera rotation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8831#p8831" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Create a ray from the camera, use Physics.Raycast to find the point of intersection with the panorama, and use PanoRenderer.GetPanTiltByWorldPosition to convert the point to pan and tilt.<br /><a href="http://infinity-code.com/doxygen/upano/class_infinity_code_1_1u_pano_1_1_renderers_1_1_base_1_1_pano_renderer.html#ac270075d8c2570a61271c698a694fad9">http://infinity-code.com/doxygen/upano/ … 98a694fad9</a></p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2023-01-18T19:45:42Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8831#p8831</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[set pan and tilt to match camera rotation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8829#p8829" />
			<content type="html"><![CDATA[<p>I mouse drag the panoramic, on Update I set main camera rotation equal to the panoramic camera rotation. Both cameras are now in sync and good.</p><p>1) Main camera,<br />2) panoramic camera</p><p>However when I first enable the panoramic and cam, how can I translate the main cameras rotation to the pan and tilt values to set the panoramic what angle it should begin?</p>]]></content>
			<author>
				<name><![CDATA[Tree2]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2374</uri>
			</author>
			<updated>2023-01-18T16:32:54Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8829#p8829</id>
		</entry>
</feed>
