12 第1页 | 共2 页下一页
返回列表 发新帖
查看: 2743|回复: 17
打印 上一主题 下一主题

[其它] ..Shockwave3d制作全景效果

[复制链接]

797

主题

1

听众

1万

积分

资深设计师

Rank: 7Rank: 7Rank: 7

纳金币
5568
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

跳转到指定楼层
楼主
发表于 2011-8-5 14:15:21 |只看该作者 |倒序浏览
360 degree panoramas in Shockwave3d - part 1

With Director 8.5 Macromedia (with Intel's help) have introduced

extensive 3d authoring capabilities in Director.

Panorama makers benefit from

this too because they now have a Shockwave3d

alternative to dedicated vr viewers (Quicktime VR, Zoom, Java pano viewers etc).

Not only can panoramas be presented very nicely solo in Shockwave3d - the web

output of Director 8.5 - but they can be enhanced with streaming media,

3d models and directional indicators.
More than this - the particular dynamic authoring possibilities of the

Director8.5 3d handling mean it is possible to use panoramic

backgrounds in a 3d content creation mode - a panoramic scene can be

scrolled/tilted freely as objects, lights, particles, characters etc

are added via scripting and the results seen in realtime.

A real world 3d-looking panoramic background image

can provide strong cues for

the arrangement and proportions, lighting and animation

of the foreground 3d elements.
The simplest way to put a panorama into Shockwave3d is to create a

sphere primitive and map a "spherical" panoramic image to its

interior - place a camera in its centre - and you are almost done.
Some "mouse down" behavior for this sprite is necessary to provide

a panoramic UI. One needs to able to pan left or right, up or down

from a fixed position. The camera should remain "unrolled" ie not

turned on an axis lengthways through the lens. The user should be

constrained from going past 90 degrees up and down. The following

Behavior script does this:
on mouseDown me
set startV = the mouseV

set startH = the mouseH


repeat while the mouseDown

mypan = member("newBox").cameraRotation[2]

mytilt = member("newBox").cameraRotation[1]

myroll = member("newBox").cameraRotation[3]




set tDX = -(the mouseH - startH) / 150.0

set tDY = -(the mouseV - startV) / 150.0
mypan =mypan + tDX
mytilt = mytilt + tDY

if mytilt >90 then

set startV= the MouseV

set tDY = -(the mouseV - startV) / 150.0

if tDY > 0 then

set tDY = 0

end if

end if
if mytilt <-90 then

set startV= the MouseV

set tDY = -(the mouseV - startV) / 150.0

if tDY < 0 then

set tDY = 0

end if

end if

member("newBox").cameraRotation = vector(mytilt, mypan, 0)
updatestage

end repeat

end
where "newBox" is the name of the 3d member containing the panoramic "set".

Note the code which tracks the tilt of the default camera also tracks the up or

down direction of the mouse dragging so that tilting is stopped appropriately at

nadir and zenith of the panorama.
A sphere has problems for pano display in Shockwave3d because it is

approximated by polygons inexactly and unless the polygon number in

the sphere is set high there will be distortions in the scene.
A box primitive is better but there is a problem

with seams at the edges showing

with software rendering - so a better solution is to take 6 cubic images

ie 90 degrees by 90 degrees and map them onto 6 square planes arranged

appropriately - then each can be moved slightly closer to the camera so

they overlap a little - and this will remove this seam issue.
Also one wants the panoramic image to be lit with its original colors

so ambient must be set to 100 percent in the shader settings for these

planes.
Thus we have the following Movie Script that generates the 6 planes "box"

set for displaying the panorama. You can see that the panorama is

generated dynamically rather than referencing a prebuilt 3d file.
Textures should be powers of 2 in dimensions so cubic textures should

be 256*256 or 512*512 etc .... 512*512 in this case:
on prepareMovie

member("newBox").resetWorld()
mr1 = member("newBox").newModelResource("myPlaneResource", #plane, #both)

mr1.length = 40

mr1.width = 40
md1 = member("newBox").newModel("myPlane1")

md2 = member("newBox").newModel("myPlane2")

md3 = member("newBox").newModel("myPlane3")

md4 = member("newBox").newModel("myPlane4")

md5 = member("newBox").newModel("myPlane5")

md6 = member("newBox").newModel("myPlane6")
md1.resource = member("newBox").modelResource("myPlaneResource")

md2.resource = member("newBox").modelResource("myPlaneResource")

md3.resource = member("newBox").modelResource("myPlaneResource")

md4.resource = member("newBox").modelResource("myPlaneResource")

md5.resource = member("newBox").modelResource("myPlaneResource")

md6.resource = member("newBox").modelResource("myPlaneResource")
mt1 = member("newBox").newTexture("myFrontTexture",#fromCastMember,member("gpo01"))

mt2 = member("newBox").newTexture("myRightTexture",#fromCastMember,member("gpo02"))

mt3 = member("newBox").newTexture("myBackTexture",#fromCastMember,member("gpo03"))

mt4 = member("newBox").newTexture("myLeftTexture",#fromCastMember,member("gpo04"))

mt5 = member("newBox").newTexture("myTopTexture",#fromCastMember,member("gpo05"))

mt6 = member("newBox").newTexture("myBottomTexture",#fromCastMember,member("gpo06"))
ms1 = member("newBox").newShader("myFrontShader", #standard)

ms2 = member("newBox").newShader("myRightShader", #standard)

ms3 = member("newBox").newShader("myBackShader", #standard)

ms4 = member("newBox").newShader("myLeftShader", #standard)

ms5 = member("newBox").newShader("myTopshader", #standard)

ms6 = member("newBox").newShader("myBottomShader", #standard)
ms1.texture = mt1

ms2.texture = mt2

ms3.texture = mt3

ms4.texture = mt4

ms5.texture = mt5

ms6.texture = mt6
(member 1 of castLib 1).model[1].shaderList[1] = (member 1 of castLib 1).shader[2]

(member 1 of castLib 1).model[2].shaderList[1] = (member 1 of castLib 1).shader[3]

(member 1 of castLib 1).model[3].shaderList[1] = (member 1 of castLib 1).shader[4]

(member 1 of castLib 1).model[4].shaderList[1] = (member 1 of castLib 1).shader[5]

(member 1 of castLib 1).model[5].shaderList[1] = (member 1 of castLib 1).shader[6]

(member 1 of castLib 1).model[6].shaderList[1] = (member 1 of castLib 1).shader[7]






ms1.ambient = rgb(255, 255, 255)

ms2.ambient = rgb(255, 255, 255)

ms3.ambient = rgb(255, 255, 255)

ms4.ambient = rgb(255, 255, 255)

ms5.ambient = rgb(255, 255, 255)

ms6.ambient = rgb(255, 255, 255)
ms1.diffuse = rgb(0, 0, 0)

ms2.diffuse = rgb(0, 0, 0)

ms3.diffuse = rgb(0, 0, 0)

ms4.diffuse = rgb(0, 0, 0)

ms5.diffuse = rgb(0, 0, 0)

ms6.diffuse = rgb(0, 0, 0)
ms1.emissive = rgb(0, 0, 0)

ms2.emissive = rgb(0, 0, 0)

ms3.emissive = rgb(0, 0, 0)

ms4.emissive = rgb(0, 0, 0)

ms5.emissive = rgb(0, 0, 0)

ms6.emissive = rgb(0, 0, 0)
ms1.specular = rgb(0, 0, 0)

ms2.specular = rgb(0, 0, 0)

ms3.specular = rgb(0, 0, 0)

ms4.specular = rgb(0, 0, 0)

ms5.specular = rgb(0, 0, 0)

ms6.specular = rgb(0, 0, 0)
md1.translate (0, 0, -19.85)

md2.translate (19.85, 0, 0)

md3.translate (0, 0, 19.85)

md4.translate (-19.85, 0, 0)

md5.translate (0, 19.85, 0)

md6.translate (0, -19.85, 0)
md1.rotate (0, 180, 0)

md2.rotate (0, 90, 0)

md3.rotate (0, 0, 0)

md4.rotate (0, -90, 0)

md5.rotate (-90, 180, 0)

md6.rotate (90, 0, 0)
member("newBox").newLight("myAmbient", #ambient)

member("newBox").light("myAmbient").color = rgb(255, 255, 255)


member("newBox").camera("defaultView").fieldOfView = 100

member("newBox").cameraPosition = vector(0,0,0)

end prepareMovie
The images for the sides of the six plane "box" are members "gpo01" etc.
Essential software for creating panoramas and working with

different panoramic perspective representations is Prof.

Helmut Dersch's great Panorama Tools.

分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

315

主题

0

听众

1万

积分

资深设计师

Rank: 7Rank: 7Rank: 7

纳金币
10878
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

沙发
发表于 2011-8-8 16:01:22 |只看该作者
很不错的样子!犀利啊
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

板凳
发表于 2011-8-10 17:01:29 |只看该作者
很经典,很实用,学习了!
回复

使用道具 举报

462

主题

1

听众

31万

积分

首席设计师

Rank: 8Rank: 8

纳金币
2
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

地板
发表于 2011-8-20 11:31:14 |只看该作者
原帖由  tc  于 2011-08-10 17:01 发表:
很经典,很实用,学习了!
-----------------------------------------------------
好用你就多用点!!!
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

5#
发表于 2012-1-30 23:28:13 |只看该作者
美酒令人回味,音乐让人陶醉,好书百读不悔,情意形影相随,节日问候最可贵。又到年终岁尾,愿你幸福健康作陪,笑得合不拢嘴,预祝春节快乐!
回复

使用道具 举报

462

主题

1

听众

31万

积分

首席设计师

Rank: 8Rank: 8

纳金币
2
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

6#
发表于 2012-2-8 23:33:01 |只看该作者
再次路过……
回复

使用道具 举报

   

671

主题

1

听众

3247

积分

中级设计师

Rank: 5Rank: 5

纳金币
324742
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

7#
发表于 2012-2-19 23:31:52 |只看该作者
我就看看,我不说话
回复

使用道具 举报

   

671

主题

1

听众

3247

积分

中级设计师

Rank: 5Rank: 5

纳金币
324742
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

8#
发表于 2012-2-20 23:20:28 |只看该作者
已阵亡的 蝶 随 风 舞 说过  偶尔按一下 CTRL A 会发现 世界还有另一面
回复

使用道具 举报

1023

主题

3

听众

359

积分

设计实习生

Rank: 2

纳金币
335582
精华
0

最佳新人

9#
发表于 2012-3-16 20:06:56 |只看该作者

回复

使用道具 举报

10

主题

1

听众

289

积分

设计实习生

Rank: 2

纳金币
289
精华
0

最佳新人

10#
发表于 2012-3-16 21:35:48 |只看该作者
回复

使用道具 举报

12 第1页 | 共2 页下一页
返回列表 发新帖
您需要登录后才可以回帖 登录 | 立即注册

手机版|纳金网 ( 闽ICP备2021016425号-2/3

GMT+8, 2025-8-5 02:35 , Processed in 0.069582 second(s), 29 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部