<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[GMan's Mods & Stuff — Camera as a parent to another object]]></title>
		<link>https://gprogs.com/viewtopic.php?id=182</link>
		<atom:link href="https://gprogs.com/extern.php?action=feed&amp;tid=182&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Camera as a parent to another object.]]></description>
		<lastBuildDate>Tue, 10 Apr 2007 02:14:32 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Camera as a parent to another object]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=728#p728</link>
			<description><![CDATA[<p>You can adjust the Offset vector to give distance from the player.<br />If you set Offset Z value you&#039;ll have more distance and Y more height.<br />Try setting the Distance value to a higher negative.<br /></p><div class="codebox"><pre><code>Local Offset:Vector3df = _VECTOR3DF( Slide, Height, Distance )</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (HondaDarrell)]]></author>
			<pubDate>Tue, 10 Apr 2007 02:14:32 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=728#p728</guid>
		</item>
		<item>
			<title><![CDATA[Re: Camera as a parent to another object]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=725#p725</link>
			<description><![CDATA[<p>Cool, but now I have another problem. Before I did this, the Camera was behind the<br />player object. Now the camera is exactly at the position of the player object.<br />Is there any way to move the camera backwards ?</p>]]></description>
			<author><![CDATA[null@example.com (porcus)]]></author>
			<pubDate>Mon, 09 Apr 2007 17:40:28 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=725#p725</guid>
		</item>
		<item>
			<title><![CDATA[Re: Camera as a parent to another object]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=722#p722</link>
			<description><![CDATA[<div class="codebox"><pre><code>...
Type MyEventReceiver Extends IEventReceiver
Method OnEvent:Int(event:SEvent)
...
...

&#039;After updating the player you need to update it&#039;s absolute position
v=player.GetRotation()
v.setY(v.getY()+60.0)
player.SetRotation(v)
Player.updateAbsolutePosition()

...
...
EndMethod
...
EndType

...

&#039;Update Camera
Local M:Matrix4 = Matrix4.create()
Local Forward:Vector3df = _VECTOR3DF( 0, 0, 1 )
Local Up:Vector3df = _VECTOR3DF( 0, 1, 0 )
Local OffSet:Vector3df = _VECTOR3DF( 0, 5, -15 )

M.setRotationDegrees( Player.GetRotation())
M.transformVect( Forward )
M.transformVect( Up )
M.transformVect( OffSet )
OffSet = Offset.Plus( Player.getPosition())
Camera.setPosition( OffSet )
Camera.setUpVector( UP )
OffSet = OffSet.Plus( Forward )
Camera.setTarget( OffSet )
Camera.updateAbsolutePosition()</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (HondaDarrell)]]></author>
			<pubDate>Sat, 07 Apr 2007 23:28:46 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=722#p722</guid>
		</item>
		<item>
			<title><![CDATA[Camera as a parent to another object]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=721#p721</link>
			<description><![CDATA[<p>If I use the camera as a parent to an other Object and I try to rotate it, the camera will not rotate correctly.</p><p>for example:</p><p>...<br />Type MyEventReceiver Extends IEventReceiver<br />Method OnEvent:Int(event:SEvent)<br />...<br />...</p><p>v=player.GetRotation()<br />v.setY(v.getY()+60.0)<br />player.SetRotation(v)</p><p>...<br />...<br />EndMethod<br />...<br />EndType</p><p>...<br />camera.setParent(player)<br />...</p><p>Why ?</p><p>(Excuse me for my bad English.)</p>]]></description>
			<author><![CDATA[null@example.com (porcus)]]></author>
			<pubDate>Sat, 07 Apr 2007 16:52:55 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=721#p721</guid>
		</item>
	</channel>
</rss>
