Camera

Eure Foren für alle Diskussionen rund ums Thema Modding.
michaelj15
Posts: 42
Joined: Sun Oct 13, 2013 12:10 pm

Camera

Post by michaelj15 »

Hallo alle,
Ich habe eine Frage zum Modding mit einer Außenkamera.
Ich habe erfolgreich eine Kamera in GE hinzugefügt und sie funktioniert auch im Spiel einwandfrei. Ich wünschte nur, diese Kamera würde sich auch mit dem Fahrzeug bewegen. Ich verwende diese Kamera an einem Gabelstapler und würde mir wünschen, dass sich diese Kamera auf und ab bewegt, sobald die Gabeln des Gabelstaplers auf und ab fahren. Ich habe die Kamera bereits unter der entsprechenden Transformationsgruppe platziert, kann sie jedoch nicht zum Laufen bringen. Irgendeine Idee? Vielen Dank im Voraus!
Haubi
Posts: 1227
Joined: Tue Nov 23, 2021 4:36 pm
Location: JVA Stadelheim

Re: Camera

Post by Haubi »

Normal sollte das ohne Probleme funktionieren. Ich machs zum Beispiel an meinen Bagger so, dass ich eine Außenkamera im Unterwagen habe und ne zweite im Oberwagen. So kann ich wählen, ob die Kamera sich mitdreht oder halt nicht. Bei nem Stapler sollte das genauso gehen, musst die Kamera halt schon da rein nehmen, wo sich die Gabel auch bewegt.
michaelj15
Posts: 42
Joined: Sun Oct 13, 2013 12:10 pm

Re: Camera

Post by michaelj15 »

Ja, das habe ich mir auch gedacht. Ich bin auch überrascht, dass es nicht funktioniert.
Haben Sie ein Beispiel für ein XML für mich?
Haubi
Posts: 1227
Joined: Tue Nov 23, 2021 4:36 pm
Location: JVA Stadelheim

Re: Camera

Post by Haubi »

Denke nicht das dein Problem in der XML liegt. Würde eher darauf tippen, dass die Kamera nicht im richtigen Teil drin ist, das eben auch auf- und abfährt. Aber bitteschön.

Code: Select all

<cameras>
	<camera node="outdoorCamera1" rotatable="true" rotateNode="outdoorCameraTarget1" limit="true" useWorldXZRotation="true" rotMinX="-1.4" rotMaxX="1" transMin="4" transMax="40" translation="0 0 6.5" rotation="-17.5 180 0" >
		<raycastNode node="cameraRaycastNode1"/>
		<raycastNode node="cameraRaycastNode2"/>
		<raycastNode node="cameraRaycastNode3"/>
	</camera>
	<camera node="outdoorCamera2" rotatable="true" rotateNode="outdoorCameraTarget2" limit="true" useWorldXZRotation="true" rotMinX="-1.4" rotMaxX="1" transMin="4" transMax="40" translation="0 0 6.5" rotation="-17.5 180 0" >
		<raycastNode node="cameraRaycastNode1"/>
		<raycastNode node="cameraRaycastNode2"/>
		<raycastNode node="cameraRaycastNode3"/>
	</camera>
	<camera node="indoorCamera1" rotatable="true" limit="true" rotMinX="-1.1" rotMaxX="0.4" transMin="0" transMax="0" useMirror="true" isInside="true" shadowFocusBox="shadowFocusBox" suspensionNodeIndex="2"/>
</cameras>
michaelj15
Posts: 42
Joined: Sun Oct 13, 2013 12:10 pm

Re: Camera

Post by michaelj15 »

Danke schön! Ich sehe, dass ich keinen Raycast-Knoten habe. Sie wissen nicht, ob das wichtig ist?
Unten ist das Bild, wie ich die Kamera eingesetzt habe. Ich habe die Kamera auch auf einer Ebene tiefer platziert, aber das macht keinen Unterschied.

https://ibb.co/ZhHds8J
Haubi
Posts: 1227
Joined: Tue Nov 23, 2021 4:36 pm
Location: JVA Stadelheim

Re: Camera

Post by Haubi »

Wenn ich das richtig sehe, ist die Kamera in mastPart01 drin, das ist aber mit Sicherheit nicht der Teil, wo sich auf und ab bewegt, somit fährt auch die Kamera nicht mit, is ja auch logisch. Die raycastNode brauchste in deinem fall nicht, braucht man eigentlich überhaupt nicht, damit steuert der LS ne bewegliche Kamera nur selbständig, wenn ein Objekt zwischen die Kam. und die Raycast Nodes kommt. Die fressen im Endeffekt auch noch Performance.
michaelj15
Posts: 42
Joined: Sun Oct 13, 2013 12:10 pm

Re: Camera

Post by michaelj15 »

Entschuldigung, es musste dieses Bild sein:

https://ibb.co/mJp12dF
Haubi
Posts: 1227
Joined: Tue Nov 23, 2021 4:36 pm
Location: JVA Stadelheim

Re: Camera

Post by Haubi »

Schaue halt in der XML unter "cylindered" bei "movingTools" nach, was den auf- und abfährt. Hier mal vom Basegame Manitu Stapler.

Code: Select all

<movingTools>
	<movingTool node="arm02" playSound="true">
                <controls axis="AXIS_FRONTLOADER_ARM" invertAxis="false" mouseSpeedFactor="0.5" iconName="FORKLIFT_TRANSLATE_Y" />
                <animation animSpeed="0.2" animAcceleration="0.8" animName="mainArmMovement" />
                <dependentPart node="hosesScale" />
                <dependentPart node="hosesScale2" />
                <dependentPart node="hosesScale3" />
                <dependentPart node="hosesScale4" />
                <componentJoint index="2" anchorActor="0"/>
            </movingTool>
            <movingTool node="arm01" playSound="true">
                <controls axis="AXIS_FRONTLOADER_TOOL" invertAxis="true" mouseSpeedFactor="0.2" iconName="FORKLIFT_ROTATE_X" />
                <rotation rotSpeed="7" rotAcceleration="150" rotMax="10" rotMin="-10" />
                <dependentPart node="mainHydraulic" />
                <componentJoint index="2" anchorActor="0"/>
            </movingTool>

            <movingTool node="tineLeft">
                <controls axis="AXIS_FRONTLOADER_TOOL2" invertAxis="true" mouseSpeedFactor="0.2" iconName="WORKING_WIDTH_TRANSLATE_X" />
                <animation animName="forkWidth" animSpeed="0.5" animAcceleration="50" animStartTime="0.7" />
            </movingTool>
</movingTools>
Hier wäre jetzt "arm02" die Adresse wo deine Kamera hinein müsste.
michaelj15
Posts: 42
Joined: Sun Oct 13, 2013 12:10 pm

Re: Camera

Post by michaelj15 »

Code: Select all

    <cylindered>
        <movingTools>
            <movingTool node="mastPart01" playSound="true">
                <controls axis="AXIS_FRONTLOADER_TOOL" invertAxis="true" mouseSpeedFactor="0.2" iconName="FORKLIFT_ROTATE_X" />
                <rotation rotSpeed="5" rotAcceleration="150" rotMax="10" rotMin="-10" />	
                <dependentPart node="HydraulicCylinderpart01" />
                <componentJoint index="2" anchorActor="0"/>	
                <componentJoint index="3" anchorActor="0"/>					
            </movingTool>		
            <movingTool node="mastPart02" playSound="true">
                <controls axis="AXIS_FRONTLOADER_ARM" invertAxis="false" mouseSpeedFactor="0.5" iconName="FORKLIFT_TRANSLATE_Y" />
                <animation animSpeed="0.2" animAcceleration="10" animName="mainArmMovement" />
                <dependentPart node="hose01Part01" />
                <dependentPart node="hose01Part03" />
                <dependentPart node="hose02Part01" />
                <dependentPart node="hose02Part03" />
                <componentJoint index="2" anchorActor="0"/>	
                <componentJoint index="3" anchorActor="0"/>					
            </movingTool>
            <movingTool node="LeftRightFork" playSound="true">
                <controls axis="AXIS_FRONTLOADER_TOOL2" invertAxis="false" mouseSpeedFactor="0.2" iconName="WORKING_WIDTH_TRANSLATE_X"/>					
                <animation animSpeed="0.6" animAcceleration="10" animName="forkMovement01" />
			</movingTool>
            <movingTool node="RightLeftFork" playSound="true">
                <controls axis="AXIS_FRONTLOADER_ARM2" invertAxis="false" mouseSpeedFactor="0.2" iconName="WORKING_WIDTH_TRANSLATE_X"/>
                <animation animSpeed="0.6" animAcceleration="10" animName="forkMovement02" />
                <componentJoint index="2" anchorActor="0"/>	
                <componentJoint index="3" anchorActor="0"/>	
			</movingTool>
			
        </movingTools>
		
        <movingParts>
Ja, genau das habe ich getan. Bei mir ist es mastpart02. Aber er macht es hier nicht :S
Haubi
Posts: 1227
Joined: Tue Nov 23, 2021 4:36 pm
Location: JVA Stadelheim

Re: Camera

Post by Haubi »

Dann weiß ich auch nicht, was de da falsch machst. :biggrin2: Ist das ne bewegliche Kamera? Falls ja, dann nimm mal die rotateNode auch mit dahinein bzw. mach es so wie bei ner Standard Außenkamera, die ja normal immer in der CameraTarget Node drin sind.
michaelj15
Posts: 42
Joined: Sun Oct 13, 2013 12:10 pm

Re: Camera

Post by michaelj15 »

Nein, es war keine bewegliche Kamera. Bei mir funktioniert es jetzt. Ich habe die Kamera auf die tiefste Ebene eingestellt. Also auf dem gleichen Niveau wie eine einzelne Gabel. Jetzt funktioniert es einwandfrei :) Danke für die Hilfe!
Haubi
Posts: 1227
Joined: Tue Nov 23, 2021 4:36 pm
Location: JVA Stadelheim

Re: Camera

Post by Haubi »

Die Logik erschließt sich mir jetzt nicht, ich vermute mal da war dann eher im i3d Mapping oder what ever ein Fehler drin. Wenn "mastpart02" auf und abfährt, die Kamera ist da drin, dann muss die mitfahren, ob die will oder nicht. :biggrin2: Aber wenn es jetzt geht, dann passt es ja. :lol:
michaelj15
Posts: 42
Joined: Sun Oct 13, 2013 12:10 pm

Re: Camera

Post by michaelj15 »

Ja, haha, ich auch nicht. Solange es funktioniert und keine Fehler im Protokoll erscheinen, bin ich damit einverstanden :lol:
ManniFest
Posts: 45
Joined: Sun Jan 09, 2022 8:11 pm

Re: Camera

Post by ManniFest »

Moin,
Nach meiner Logik wird eine Kamera, die nicht an der Zinke hängt, sich auch nicht mit der Zinke bewegen, weil das ja klar ist...^^
Post Reply