Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set initial camera rotation and position #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JeffTomlinson
Copy link

@JeffTomlinson JeffTomlinson commented Jul 29, 2017

Set initial camera rotation and position

This PR introduces the following changes:

  • Handles properties for setting initial camera rotation and position in a scene.

Steps to Test

  • Checkout this branch.
  • Run yarn or npm i in this repo's root.
  • Run npm run start in this repo's root.
  • Navigate to the IP address:port given to you in the start script output in Chrome on your phone, which should be connected to the same network as your computer. (And not using a VPN).
  • Visit a scene and note the initial scene orientation (camera rotation).
  • Edit the scene and add the camera property:
const scene1 = {
  name: 'scene1',
  sky: require('../../assets/images/scenes/scene1.jpg'),
  camera: {
    rotation: '0 180 0',
  },
  scene: () => (
...
  • You should now be facing the opposite direction when the scene loads.

Copy link
Contributor

@patrickocoffeyo patrickocoffeyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Teeny tiny comment!

@@ -72,4 +74,18 @@ class Camera extends Component {
}
}

Camera.propTypes = {
rotation: PropTypes.string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be adjusted so that it's an object containing x, y, and z coords like position?

@@ -4,7 +4,7 @@
*/

import { Entity } from 'aframe-react';
import React, { Component } from 'react';
import React, { Component, PropTypes } from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self... update react and add the prop-types module separately 💃

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a ticket 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants