当前位置:网站首页>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
边栏推荐
- C language learning notes (mind map)
- Analysis of the problems of the 11th Blue Bridge Cup single chip microcomputer provincial competition
- [at] abc 258G - Triangle 三元組可達-暴力
- Pycharm remote ssh pyenv error: pydev debugger: warning: trying to add breakpoint to file that does
- Project experience sharing: handwritten Chinese character recognition based on Shengsi mindspire
- HDMI2.1与HDMI2.0的区别以及转换PD信号。
- Huawei switch basic configuration (telnet/ssh login)
- Huawei switch console password reset, device initialization, default password
- Go language foundation ----- 08 ----- interface
- Register keyword
猜你喜欢
WorldView卫星遥感影像数据/米级分辨率遥感影像
Go language foundation ----- 04 ----- closure, array slice, map, package
Go language foundation ----- 18 ----- collaboration security, mutex lock, read-write lock, anonymous lock, sync Once
Technical dry goods | thinking about the unification of dynamic and static diagrams of AI framework
C language learning notes (mind map)
PAT甲级 1028 List Sorting
Worldview satellite remote sensing image data / meter resolution remote sensing image
Go language foundation ----- 06 ----- anonymous fields, fields with the same name
一篇文章让你读懂-曼彻斯特编码
【LeetCode】3. Merge Two Sorted Lists·合并两个有序链表
随机推荐
Go language foundation ----- 06 ----- anonymous fields, fields with the same name
experiment.........
Huawei switch: configure Telnet, SSH and web access
Wechat native applet cloud development learning record 01
Go language foundation ----- 07 ----- method
What is a data type? What is the use of data types?
[MySQL 11] how to solve the case sensitive problem of MySQL 8.0.18
[MySQL 12] MySQL 8.0.18 reinitialization
idea取消引用顯示效果
PAT甲级 1029 Median
Screenshot tool snipaste
[MySQL 13] if you change your password for the first time after installing mysql, you can skip MySQL password verification to log in
【LeetCode】3. Merge two sorted lists · merge two ordered linked lists
Go language foundation ----- 15 ----- reflection
[MySQL 14] use dbeaver tool to remotely backup and restore MySQL database (Linux Environment)
Usage of requests module
Redis batch startup and shutdown script
Redis查看客户端连接
Quelle est la définition? Qu'est - ce qu'une déclaration? Quelle est la différence?
Getting started with minicom