<?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 — how to rotate camera]]></title>
		<link>https://gprogs.com/viewtopic.php?id=365</link>
		<atom:link href="https://gprogs.com/extern.php?action=feed&amp;tid=365&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in how to rotate camera.]]></description>
		<lastBuildDate>Thu, 12 Mar 2009 14:32:26 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: how to rotate camera]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1405#p1405</link>
			<description><![CDATA[<p>got it thanks</p>]]></description>
			<author><![CDATA[null@example.com (Slenkar)]]></author>
			<pubDate>Thu, 12 Mar 2009 14:32:26 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1405#p1405</guid>
		</item>
		<item>
			<title><![CDATA[Re: how to rotate camera]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1403#p1403</link>
			<description><![CDATA[<p>greetings <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" />&nbsp; there is a new method in v1.5 on ICameraSceneNode that makes the camera look in the same direction as rotations.&nbsp; look up the method:</p><p>ICameraSceneNode.bindTargetAndRotation()</p>]]></description>
			<author><![CDATA[null@example.com (gman)]]></author>
			<pubDate>Wed, 11 Mar 2009 01:10:40 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1403#p1403</guid>
		</item>
		<item>
			<title><![CDATA[Re: how to rotate camera]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1397#p1397</link>
			<description><![CDATA[<p>got it, thanks</p><p>It was pointing at 0.0.0 <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (Slenkar)]]></author>
			<pubDate>Tue, 10 Mar 2009 12:46:27 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1397#p1397</guid>
		</item>
		<item>
			<title><![CDATA[Re: how to rotate camera]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1396#p1396</link>
			<description><![CDATA[<p>That&#039;s because cameras are always pointing at a target. You would have to change to camera target too.<br />Check out irrb3d for this there should be the solution somewhere.</p>]]></description>
			<author><![CDATA[null@example.com (porcus)]]></author>
			<pubDate>Tue, 10 Mar 2009 09:53:41 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1396#p1396</guid>
		</item>
		<item>
			<title><![CDATA[how to rotate camera]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1393#p1393</link>
			<description><![CDATA[<p>heres the code:<br /></p><div class="codebox"><pre><code>SuperStrict
Framework Irrlicht.Core



Local receiver:IEventReceiver=IEventReceiver.Create(MyEventReceiver.generate)

Local device:IrrlichtDevice = ..
    IrrlichtDevice.Create(EDT_DIRECT3D9, _DIMENSION2DI(640, 480), 16, ..
        False, False, False, receiver)
        Local driver:IVideoDriver = device.getVideoDriver()
Local smgr:ISceneManager = device.getSceneManager()
Local guienv:IGUIEnvironment = device.getGUIEnvironment()
Rem
We add a hello world label To the window, using the GUI environment.
EndRem
guienv.addStaticText(&quot;Hello World! This is the Irrlicht Software renderer!&quot;, ..
    _RECTI(10,10,260,22),True)
device.setWindowCaption(&quot;Hello World! - Irrlicht Engine Demo&quot;)

Local mesh:IMesh = smgr.getMesh(&quot;ship_models/11.b3d&quot;)


Global node:ImeshSceneNode = smgr.addmeshSceneNode(mesh)

Global globnode:Ilightscenenode=smgr.addlightscenenode()
Function TFormPoint:Vector3df(x:Float,y:Float,z:Float,source:ISceneNode,dest:ISceneNode)
    Local lastTForm:Vector3df=_VECTOR3DF(x,y,z)

    &#039; first convert to world from the source
    If source Then source.getAbsoluteTransformation().transformVect(lastTForm)

    &#039; now from world to local
    If dest Then dest.getRelativeTransformation().transformVect(lastTForm)
    
    Return lastTForm
EndFunction

If (node)
    node.setMaterialFlag(EMF_LIGHTING, False)
    &#039;node.setMD2Animation ( EMAT_STAND )
    node.setMaterialTexture( 0, driver.getTexture(&quot;ship_models\blueship-low.png&quot;) )
EndIf

Type MyEventReceiver Extends IEventReceiver
    Method OnEvent:Int(event:SEvent)
    
        If (node And event.getEventType()=EET_KEY_INPUT_EVENT And ..
            Not event.getKeyPressedDown())
            
            Local key:Int=event.getKeyInputKey()
                    
            Select key
                Case EKEY_KEY_W
                    Local v:Vector3df=node.GetRotation()
                    v.setY(v.getY()+2.0)
                    node.SetRotation(v)
                    Return True
                Case EKEY_KEY_S
                    Local v:Vector3df=node.GetRotation()
                    v.setY(v.getY()-2.0)
                    node.SetRotation(v)
                    Return True
                Default
                    Return False
            EndSelect
        EndIf

        Return False
    EndMethod

    &#039; we must override the generate function in order for instantiation to work properly
    Function generate:IEventReceiver()
        Return New MyEventReceiver
    EndFunction
EndType

Global camera:Icamerascenenode=smgr.addCameraSceneNode()&#039;(Null, _VECTOR3DF(0,30,-40), _VECTOR3DF(0,5,0))


Local i#
node.SetRotation(_vector3df(0,90,0))
While(device.run())

    driver.beginScene(True, True, _SCOLOR(0,0,0,140))


node.setposition(TFormPoint(0,0,10,node,globnode))
Local nodepos:vector3df=node.getposition()
Local noderot:vector3df=node.GetRotation()

camera.setposition(TFormPoint(0,0,15,node,globnode))
camera.SetRotation(noderot)

    smgr.drawAll()
    guienv.drawAll()

    driver.endScene()
Wend


device.drop()</code></pre></div><p>thing is, no matter what I change the camera rotation to.. it always points at the mesh, instead of pointing in the same direction as the mesh.</p><p>AND</p><p> if i put the camera behind the mesh it NEVER faces the ship</p><p>EDIT<br />nevermind I had to bind the cameras rotation and target</p>]]></description>
			<author><![CDATA[null@example.com (Slenkar)]]></author>
			<pubDate>Mon, 09 Mar 2009 17:25:47 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1393#p1393</guid>
		</item>
	</channel>
</rss>
