当前位置:网站首页>Viz artist advanced script video tutorial -- stringmap use and vertex operation
Viz artist advanced script video tutorial -- stringmap use and vertex operation
2022-07-03 07:54:00 【hjm2046】
The ultimate effect of our video tutorial today is like this

What you see is a small one loops In a big circle Bumping around , Pass your own color to the one you hit circle .
Scripts mainly involve : Angular mirroring , Vector and StringMap
1. Angle mirror and vector , These two are mainly used to calculate small loops The direction of movement , Calculate the opposite path when you hit something , Otherwise, keep the previous direction of travel .
2. StringMap, It is mainly used to store each small loops The direction of movement , With each container Of ID As Key.
Artist About... In the script document StringMap Introduction to :

stringMap The simple usage is as follows :
dim dir_Map as stringMap ' Statement stringmap
dir_map["001"]="DAVID" ' assignment
dim name=(String)dir_map["001"] ’ Value Excuse me , Take a video tutorial :height="498" width="510" src="http://player.youku.com/embed/XMTQ1MTM4ODUwMA==" frameborder="0" allowfullscreen="">
Youku's video quality is not good , You can go Vimeo watch Clearer video : Click to open the link
Download the scene in the video via file , Please take a look at the QR code of the avatar in the video or on the left of this article , Pay attention to my micro signal , send out SM*(* No. is replaced by the red appearing in this article circle The number of words , Be careful if you are not good at math ) Get the scene download address , Math is not good Or students who like to read the code directly , So please see :
dim ori,hitc as StringMap
dim ring_c as container=scene.findcontainer("Ring")
sub OnExecPerField()
dim dot_c as container=childcontainer
do while dot_c<> null
if not dot_c.active then exit do
dim c_id as string=(string)dot_c.vizid
if not ori.ContainsKey(c_id) then ori[c_id]=cvertex(2.0,1.0,0.0)
dim hit=hitc[c_id]
dim dir = (vertex)ori[c_id]
dim dot_c_pos,ring_c_pos as vertex
dot_c_pos=dot_c.position.xyz
dot_c_pos+=dir
dot_c_pos.z=0
dim dot_c_radius=dot_c.scaling.x*50.0
ring_c_pos=ring_c.position.xyz
if distance(ring_c_pos,dot_c_pos)>140-dot_c_radius then
dir=-dir.MirrorAroundVector(ring_c_pos-dot_c_pos)
hitc[c_id]=ring_c
ring_c.material=dot_c.material
end if
dim tc as container=scene.findcontainer("CIRCLE").childcontainer
do while tc<> null
if not tc.active then exit do
dim tc_radius = tc.scaling.x*50
dim tc_position= tc.position.xyz
if distance(tc_position,dot_c_pos)<tc_radius+dot_c_radius and tc<>hit then
dir=-dir.MirrorAroundVector(tc_position-dot_c_pos)
hitc[c_id]=tc
tc.material=dot_c.material
end if
tc=tc.nextcontainer
loop
dir.z=0.0
dir.Normalize()
dir *=2.5
ori[c_id]=dir
dot_c.position.xyz=dot_c_pos
dot_c=dot_c.nextcontainer
loop
end sub边栏推荐
- experiment.........
- Huawei switches are configured with SSH login remote management switches
- Microsoft Security Response Center
- Professor Zhang Yang of the University of Michigan is employed as a visiting professor of Shanghai Jiaotong University, China (picture)
- 创业团队如何落地敏捷测试,提升质量效能?丨声网开发者创业讲堂 Vol.03
- jsutlis
- idea取消引用顯示效果
- [at] ABC 258g - triple Reach - violence
- Go language foundation ----- 06 ----- anonymous fields, fields with the same name
- EtherCAT state machine transition (ESM)
猜你喜欢

WorldView卫星遥感影像数据/米级分辨率遥感影像

How to configure GDAL under idea

STM32F103 SPI (pit Diary)

PAT甲级 1032 Sharing

Pycharm remote ssh pyenv error: pydev debugger: warning: trying to add breakpoint to file that does

Go language foundation ----- 01 ----- go language features

C language learning notes (mind map)

VMware virtual machine configuration static IP

HarmonyOS第三次培训笔记

PAT甲级 1029 Median
随机推荐
输入三次猜一个数字
华为交换机:配置telnet和ssh、web访问
Docker installs MySQL and successfully uses Navicat connection
Huawei s5700 switch initialization and configuration Telnet, SSH user methods
Go language foundation ------ 12 ------ JSON
Worldview satellite remote sensing image data / meter resolution remote sensing image
tslib库的移植
JS regular case-
Analysis of the problems of the 12th Blue Bridge Cup single chip microcomputer provincial competition
haproxy+keepalived搭建01
PAT甲级 1031 Hello World for U
基于RNA的新型癌症疗法介绍
优质博客——
什麼是定義?什麼是聲明?它們有何區別?
PAT甲级 1030 Travel Plan
How to configure GDAL under idea
Wechat native applet cloud development learning record 01
Huawei switches are configured with SSH login remote management switches
Go language foundation ------17 ----- channel creation, read-write, security shutdown, multiplexing select
Pycharm remote ssh pyenv error: pydev debugger: warning: trying to add breakpoint to file that does