<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: screentoworld with depth</title>
		<atom:link href="http://cycling74.com/forums/topic/screentoworld-with-depth/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/screentoworld-with-depth/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 18:52:47 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/screentoworld-with-depth/#post-25396</guid>
					<title><![CDATA[screentoworld with depth]]></title>
					<link>http://cycling74.com/forums/topic/screentoworld-with-depth/#post-25396</link>
					<pubDate>Thu, 13 Apr 2006 04:44:43 +0000</pubDate>
					<dc:creator>Ted</dc:creator>

					<description>
						<![CDATA[
						<p>Hello,</p>
<p>Does anyone know a simple solution to map the screen to world when depth is involved. The following is an axample which needs modification, because the coordinates are off when depth is not zero.<br />
Thanks.<br />
Charles.</p>
<p>// create our listener object for our window<br />
var mylistener = new JitterListener(&#8220;listentestwindow&#8221;,callbackfun);<br />
var x1, y1, z1;	<br />
z1 = 0;<br />
var zscalar = 1;<br />
function callbackfun(event)<br />
{	<br />
	var x,y,button;<br />
	if (event.eventname==&#8221;mouse&#8221;) {<br />
		// arguments are (x,y,button,cmd,shift,capslock,option,ctrl)<br />
		x = (event.args[0]-z1);<br />
		y = (event.args[1]-z1);<br />
		var world = render.screentoworld(x,y);<br />
		post(&#8220;x,&#8221;, x, &#8220;y&#8221;, y);post();<br />
		if (event.args[6] == 0){<br />
		x1 = (world[0]);<br />
	 	y1 = (world[1]);<br />
		}<br />
		if (event.args[6] == 1){<br />
		x1 = world[0];<br />
		z1 = world[1] * zscalar;<br />
		}<br />
		jsketch.position = [x1, y1, z1]</p>
<p>	} <br />
}<br />
callbackfun.local = 1;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/screentoworld-with-depth/#post-74731</guid>
					<title><![CDATA[Re: screentoworld with depth]]></title>
					<link>http://cycling74.com/forums/topic/screentoworld-with-depth/#post-74731</link>
					<pubDate>Thu, 13 Apr 2006 09:23:15 +0000</pubDate>
					<dc:creator>VG</dc:creator>

					<description>
						<![CDATA[
						<p></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/screentoworld-with-depth/#post-74732</guid>
					<title><![CDATA[Re: screentoworld with depth]]></title>
					<link>http://cycling74.com/forums/topic/screentoworld-with-depth/#post-74732</link>
					<pubDate>Thu, 13 Apr 2006 21:20:27 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>Hi Charles,</p>
<p>Could you better formulate your question and provide a clear example  <br />
and description of what you&#8217;re expecting and what&#8217;s being returned.  <br />
Sorry but we&#8217;re too busy to make these sorts of guesses. If you  <br />
provide a z argument (as distance from the *camera*, 0-1 where 0 is  <br />
the near clipping plane and 1 is the far clipping plane), screen to  <br />
world will give you the world position at that distance from the camera.</p>
<p>In the following situation, perhaps you want to manipulate an  <br />
existing object. If so, I might suggest you call worldtoscreen to  <br />
determine the screen depth coordinate of the existing object first  <br />
and make use of it in your calculation. Though this is complete  <br />
speculation as I&#8217;m not sure what you&#8217;re trying to accomplish with the  <br />
following.</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/screentoworld-with-depth/#post-74733</guid>
					<title><![CDATA[Re: screentoworld with depth]]></title>
					<link>http://cycling74.com/forums/topic/screentoworld-with-depth/#post-74733</link>
					<pubDate>Thu, 13 Apr 2006 21:37:07 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>
On Apr 13, 2006, at 2:23 AM, Vincent Goudard wrote:</p>
<p>> I am also interested by the world2screen ferature, which<br />
> unfortunately doesn&#8217;t appear in the render object, when<br />
> used outside a javascript.</p>
<p>This will be present in Jitter 1.5.3, however for the time being, you  <br />
can make a very simple jit.gl.render wrapper in JS to accomplish this  <br />
feature. For an example of dispatching arbitrary messages (for  <br />
methods and attributes) to a JS instantiated Jitter object, you might  <br />
want to check out the jsmoviebank.js example. For example:</p>
<p>var myjitobj = new JitterObject(&#8220;jit.whatever&#8221;);</p>
<p>function anything()<br />
{<br />
	//pass off all other messages to the wrapped Jitter Object<br />
	var a = arrayfromargs(arguments);</p>
<p>	// detect if method or attribute and call method or set property  <br />
accordingly<br />
	// methods are instances of the function class, detected with the  <br />
isPrototypeOf method<br />
	if (Function.prototype.isPrototypeOf(myjitobj[messagename])) {<br />
		myjitobj[messagename](a);	<br />
	} else {<br />
		myjitobj[messagename] = a;	<br />
	}<br />
}</p>
<p>
> It seems yours is using a render and window outside a jsui, is it?</p>
<p>Looks like it&#8217;s a JS instantiated instance of jit.gl.render.</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

