three.js如何改变立方体的轴位置

时间:2016-11-23 10:41:57

标签: javascript three.js voxel

我目前正在与three.js(体素画家)合作开展一个项目。当我改变立方体的大小时,我遇到一个问题,xyz轴保持在立方体的中心,而不是放在立方体的最左边,当立方体被放置在网格上时,它会移动立方体

   cubegeo= new THREE.BoxGeometry(100, 50, 70)

我想要什么

enter image description here

默认情况下为three.js

enter image description here

1 个答案:

答案 0 :(得分:0)

您可以将矩阵应用于cubegeo:

   <http:listener-config name="HTTP_Listener_Configuration"
            host="localhost" port="8081" doc:name="HTTP Listener 
    Configuration" />

        <sfdc:config-with-oauth name="salesforce-oauth"
            onNoToken="EXCEPTION"
       accessTokenUrl="https://app.my.salesforce.com/services/oauth2/token"

     authorizationUrl="https://app.my.salesforce.com/services/oauth2/authorize"
            consumerKey="myConsumerKey"
            consumerSecret="33388E8E" doc:name="Salesforce (OAuth)">
            <sfdc:oauth-callback-config domain="localhost"
                localPort="8081" remotePort="8081" path="AppCallBack" />
        </sfdc:config-with-oauth>

   <flow name="authorize" doc:name="authorize">
            <http:listener config-ref="HTTP_Listener_Configuration"  allowedMethods="GET" 
                path="authorize" doc:name="HTTP">
                <http:response-builder statusCode="200" reasonPhrase="You have successfully authorized the connector. Your access token id is: #[flowVars.OAuthAccessTokenId]" />
                <http:error-response-builder statusCode="404" reasonPhrase="An error has occurred authorizing the connector" />
            </http:listener>
            <sfdc:authorize immediate="TRUE" config-ref="salesforce-oauth"  display="PAGE" doc:name="Authorize at Salesforce" />
        </flow>

  <flow name="sfdctestFlow1" doc:name="readContactFlow1">
            <http:listener config-ref="HTTP_Listener_Configuration"
                path="run" doc:name="HTTP" />
            <sfdc:query config-ref="salesforce-oauth" accessTokenId="#[flowVars.OAuthAccessTokenId]"
                doc:name="Perform a query at Salesforce" query="SELECT id,lastname,lastmodifieddate from contact limit 10" />
            <foreach doc:name="For Each">
                <logger doc:name="Logger" level="INFO" message="contact: #[payload]" />
            </foreach>
            <set-payload doc:name="Set Payload to formatted output"
                value="Salesforce query returned #[payload.size()] contacts." />
            <logger doc:name="Logger" level="INFO" message="contact: #[payload]" />
        </flow>