纳金网

标题: [初阶教程]3D Life Player Commands : GetCurrentScene [打印本页]

作者: Asen    时间: 2011-9-2 08:27
标题: [初阶教程]3D Life Player Commands : GetCurrentScene

   
        
            
            
               
                    
                        
                        
                           
                                
                                    
                                    
                                       
                                            
                                                
                                                Instruction: 在网页浏览器中获得当前运行场景的名字

                                                Building Block:

                                                *[BB] Set As Active Camera(Cameras/Montage)

                                                *[BB] Set Camera Target(Cameras/Basic)
                                                JavaScript:

                                                function LaunchTheScene(SceneName)

                                                { var cmd = "LaunchScene" + " ’" + SceneName + "’" ;

                                                alert(cmd);

                                                var res = document.VirtoolsATL.DoCommand(cmd); }

                                                function GetCurrentScene()

                                                { var cmd = "GetCurrentScene";

                                                var res = document.VirtoolsATL.DoCommand(cmd);

                                                alert(res); }
                                                HTML:

                                                <a href="#" OnClick="LaunchTheScene(’scene1’);return true;"> Activate scene 1 </a>

                                                <a href="#" OnClick="LaunchTheScene(’scene2’);return true;"> Activate scene 2 </a>

                                                <a href="#" OnClick="GetCurrentScene();return true;"> Get The name of the current scene </a>
                                                制作步骤:
                                                一、素材建立

                                                

                                                  a )  第一步我们先从Get Current Scene文件夹里导入blue_cube,blue_star到3D Layout窗口中
                                                
                                                

                                                
                                                b )  调整场景视角,分别让blue_cube和blue_star在3D Layout窗口中最大化显示,并为场景添加两台台摄影机
                                                
                                                

                                                
                                                 c )  给新增的两台摄影机重新命名
                                                
                                                 d )  对摄影机进行创建脚本,让程序在一开始执行就将其设定为当前活动的摄影机,设定摄影机的拍摄的目标物为blue_cube,blue_star
                                                

                                                

                                                
                                                
                                                
                                                
                                                
                                            
                                            
                                                
                                            
                                            
                                                
                                                
                                                    上一篇文章: ParticleDeflectors : BoxDeflector
                                                
                                                

                                                
                                                    下一篇文章: 3D Life Player Commands : GetLevel
                                                
                                                
                                            
                                            
                                                
                                            
                                            
                                                
                                            
                                       
                                    
                                    
                                       
                                            
                                                相关内容:

                                                
                                                   
                                                        
                                                            ParticleInteractors : Particle Atmosphere

                                                            ParticleDeflectors : 2Magnets

                                                            ParticleInteractors : Gravity

                                                            ParticleInteractors : Magnet

                                                            3D Life Player Commands : Keep KeyBoard

                                                            3D Life Player Commands : StopFullScreen

                                                            3D Life Player Commands : PauseInput - ResumeInput

                                                            ParticleInteractors : Magnet

                                                            3D Life Player Commands : Set Attribute

                                                            3D Life Player Commands : GetLevel
                                                        
                                                   
                                                
                                                
                                            
                                            
                                                
                                            
                                       
                                    
                                    
                                
                                
                                    
                                
                           
                        
                        
                           
                                
                                    
                                
                           
                        
                        
                        
                    
               
            
            
            
            
               
                    
                        
                    
               
            
            

            
               
                    
                        ◎ 专题活动
                    
                    
                        ◎ 热点内容
                    
                    
                        ◎ 推荐内容
                    
               
            
                  

            
        
   

e )  新建两个Scene


f )  将blue_cube,cam1放到Scene1,将blue_star,cam2放到Scene2







g )  设定3D Layout中Screens Size屏幕大小

h )  将这个Composition发布成网页,Window Size输入成800*600,并将Save As Cmo选项叉选。
  
二、在Dreamweaver中编辑HTML源代码
  a )  选择发布后的网页,鼠标右击,选择使用Dreamweaver编辑




b )  给<head>标签添加JavaScript




c )  在Div标签内嵌入Object标签,Object的属性和参数值如图:




d )  Active Scene 1,Active Scene 2,Get name of the current scene按钮,及触发事件的定义如图:




e )   测试播放

作者: C.R.CAN    时间: 2012-1-22 23:25
时间穿越一年四季,牵挂紧紧攥在手里;平凡忙碌又到年底,无形中把自己当成了工具;松一松疲惫的身体,梳一梳心灵的沉积。挣钱重要,更要保重自己!

作者: tc    时间: 2012-2-12 23:32
先垫一块,再说鸟

作者: C.R.CAN    时间: 2012-2-23 23:29
呵呵,很漂亮啊

作者: 奇    时间: 2012-3-4 23:21
好可爱的字,学习了

作者: C.R.CAN    时间: 2012-3-9 23:18
真不错,全存下来了.

作者: 菜刀吻电线    时间: 2012-3-27 23:18
心中有爱,爱咋咋地

作者: 菜刀吻电线    时间: 2012-3-29 23:22
好可爱的字,学习了

作者: tc    时间: 2012-4-13 23:23
很经典,很实用,学习了!

作者: tc    时间: 2012-5-6 23:21
不会吧,太恐怖了

作者: 菜刀吻电线    时间: 2012-5-25 23:18
我看看就走,你们聊!

作者: 菜刀吻电线    时间: 2012-6-9 23:27
加精、加亮滴铁子,尤其要多丁页丁页

作者: C.R.CAN    时间: 2012-6-10 23:18
佩服,好多阿 ,哈哈

作者: 晃晃    时间: 2012-7-11 23:20
楼主收集的可真全哦

作者: 菜刀吻电线    时间: 2012-8-19 23:45
俺是新人,这厢有礼了!

作者: 菜刀吻电线    时间: 2012-8-30 00:24
谢谢楼主,真是太实用了

作者: tc    时间: 2012-8-30 00:52
我是老实人,我来也!

作者: tc    时间: 2012-9-24 23:20
楼主收集的可真全哦

作者: 晃晃    时间: 2013-2-10 23:21
我看看就走,你们聊!

作者: C.R.CAN    时间: 2013-2-14 23:25
好`我顶``顶顶

作者: 菜刀吻电线    时间: 2013-3-3 23:55
先垫一块,再说鸟





欢迎光临 纳金网 (http://go.narkii.com/club/) Powered by Discuz! X2.5