当前位置: 首页 > news >正文

站长工具查询网网站建站推广

站长工具查询网,网站建站推广,网站建设方案2000字,cpa网站怎么做本主题讨论透视相机以及如何为远距离环境设置合适的视锥体。 推荐:用 NSDT编辑器 快速搭建可编程3D场景 透视相机是一种投影模式,旨在模仿人类在现实世界中看待事物的方式。 这是渲染 3D 场景最常用的投影模式。 - three.js 如果你看一下 Three.js 文档…

本主题讨论透视相机以及如何为远距离环境设置合适的视锥体。

在这里插入图片描述

推荐:用 NSDT编辑器 快速搭建可编程3D场景

透视相机是一种投影模式,旨在模仿人类在现实世界中看待事物的方式。 这是渲染 3D 场景最常用的投影模式。 - three.js

如果你看一下 Three.js 文档中的透视相机构造函数,它会是这样的:

new THREE.PerspectiveCamera( fov, aspect, near, far )

其中:

  • fov:相机视野
  • aspect: 相机宽高比;
  • near:相机近平面
  • far:相机远平面。

这些参数共同定义了相机的视锥体 - 3D 场景的区域将被渲染并出现在屏幕上。

例如:

const camera = new THREE.PerspectiveCamera( 45, width / height, 1, 1000 );

基本上,你可以将 fov、near、far 设置为你想要的任何范围。 例如,将 fov 调整到 10 或 20 左右,你将很容易看到物体的正面,或者实际上所有内容都放大到屏幕上,而如果将 fov 设置为 100 中的 90 左右,则场景中的所有内容都会移得很远。

那么 near 和 far 呢?

当然,你也可以设置近平面和远平面的任意值,但如果近远范围很大,那么近距离时会出现更多的 z-fighting,而如果范围太小,则会破坏场景。

理想情况下,如果你设置 near = 0.01,那么far应该是1000,或者 near = 1,那么你可以进一步设置 far = 10000。

但是,如果你确实需要像长距离这样的东西,可以使用 near = 0.0000000001 和 far = 10000000000000。但在这种情况下,您可能需要另一个选项来配置 WebGLRenderer。

为什么?

原因是 GPU 的精度有限,无法确定某个物体是在其他物体的前面还是后面。 这种精度分布在近处和远处。 更糟糕的是,默认情况下靠近相机的精度是详细的,而远离相机的精度是粗略的。 这些单位从近开始,随着接近远而慢慢扩展。 - Threejsfundamentals.org

为了说明这种情况,我们有一个带有 3D 模型的简单场景,相机、渲染器的设置如下:

// camera
this.camera = new THREE.PerspectiveCamera(45,window.innerWidth / window.innerHeight,0.00000001,10000
);
this.camera.position.set(10, 6, 10);// renderer
this.renderer = new THREE.WebGLRenderer({ antialias: true });
this.renderer.setPixelRatio(window.devicePixelRatio);
this.renderer.setSize(window.innerWidth, window.innerHeight);
this.renderer.physicallyCorrectLights = true;
this.renderer.outputEncoding = THREE.sRGBEncoding;

你认为会发生什么?

3D 模型出了问题,你可以看到纹理全部损坏。 这是 z -fighting的示例,其中计算机上的 GPU 没有足够的精度来确定哪些像素在前面、哪些像素在后面。
在这里插入图片描述

有一个解决方案是你需要告诉 Three.js 使用不同的方法来计算哪些像素在前面,哪些像素在后面。 我们可以通过在 WebGLRenderer 构造函数中启用 logarithmicDepthBuffer 来做到这一点。

所以我们的渲染器现在看起来像这样:

// renderer
this.renderer = new THREE.WebGLRenderer({ antialias: true,logarithmicDepthBuffer: true
});
// ...

检查结果,它应该可以工作…
在这里插入图片描述

logarithmicDepthBuffer 显然可以解决这个问题,但并不总是建议使用它,因为它可能比标准解决方案慢,尤其是在大多数移动设备中。

这意味着你应该始终调整近距和远距以满足你的需要。 现在,请注意,如果想绘制一个距离很远的巨大场景而不破坏场景中的任何对象,你可以尝试一下还有一个替代选项。

希望这可以帮助!


原文链接:相机参数及z-fighting解决方案 — BimAnt


文章转载自:
http://dinncoroister.zfyr.cn
http://dinncobaptistery.zfyr.cn
http://dinncogymkana.zfyr.cn
http://dinncopipul.zfyr.cn
http://dinncomooey.zfyr.cn
http://dinncoannexure.zfyr.cn
http://dinncoretinoblastoma.zfyr.cn
http://dinncoelectrostatics.zfyr.cn
http://dinncochordate.zfyr.cn
http://dinncosoak.zfyr.cn
http://dinncotungusic.zfyr.cn
http://dinncohammal.zfyr.cn
http://dinncoseram.zfyr.cn
http://dinncounveracious.zfyr.cn
http://dinncosubcontrary.zfyr.cn
http://dinncojildi.zfyr.cn
http://dinncodealt.zfyr.cn
http://dinncocrabgrass.zfyr.cn
http://dinncocarman.zfyr.cn
http://dinncospumescence.zfyr.cn
http://dinncogalleried.zfyr.cn
http://dinncocrasher.zfyr.cn
http://dinncokatrina.zfyr.cn
http://dinncokerala.zfyr.cn
http://dinncoderanged.zfyr.cn
http://dinncopenang.zfyr.cn
http://dinncoprestidigitator.zfyr.cn
http://dinncometier.zfyr.cn
http://dinncoprinciple.zfyr.cn
http://dinncopinon.zfyr.cn
http://dinncoelasticized.zfyr.cn
http://dinnconavigable.zfyr.cn
http://dinncocrofter.zfyr.cn
http://dinncorevoltingly.zfyr.cn
http://dinncohydronitrogen.zfyr.cn
http://dinncoinvalid.zfyr.cn
http://dinncosilverbeater.zfyr.cn
http://dinncobraillewriter.zfyr.cn
http://dinncochromophotograph.zfyr.cn
http://dinncokephalin.zfyr.cn
http://dinncoencystment.zfyr.cn
http://dinncoslablike.zfyr.cn
http://dinncodominium.zfyr.cn
http://dinncosocinian.zfyr.cn
http://dinncotarradiddle.zfyr.cn
http://dinncoincorruption.zfyr.cn
http://dinncozymotechnics.zfyr.cn
http://dinncotosh.zfyr.cn
http://dinncoaphthongal.zfyr.cn
http://dinncoacrogenous.zfyr.cn
http://dinncowrinkle.zfyr.cn
http://dinncoartisanry.zfyr.cn
http://dinncopolyphonous.zfyr.cn
http://dinncosucculent.zfyr.cn
http://dinncodoctrine.zfyr.cn
http://dinncodichondra.zfyr.cn
http://dinncooverproduction.zfyr.cn
http://dinncofissive.zfyr.cn
http://dinncosilk.zfyr.cn
http://dinncohengest.zfyr.cn
http://dinncoprogramable.zfyr.cn
http://dinncoindelicacy.zfyr.cn
http://dinncopricewise.zfyr.cn
http://dinncokimberlite.zfyr.cn
http://dinncorelocation.zfyr.cn
http://dinncodeuteranope.zfyr.cn
http://dinncoclootie.zfyr.cn
http://dinncoautoimmunization.zfyr.cn
http://dinncoholdall.zfyr.cn
http://dinncoalbumose.zfyr.cn
http://dinncovapidness.zfyr.cn
http://dinnconidus.zfyr.cn
http://dinncominerva.zfyr.cn
http://dinncohandedness.zfyr.cn
http://dinncothitherward.zfyr.cn
http://dinncotyrosinosis.zfyr.cn
http://dinncocathedratic.zfyr.cn
http://dinncodomaine.zfyr.cn
http://dinncoquixotism.zfyr.cn
http://dinncoheigh.zfyr.cn
http://dinncopob.zfyr.cn
http://dinncoexult.zfyr.cn
http://dinncoammonite.zfyr.cn
http://dinncogallinipper.zfyr.cn
http://dinncomegawatt.zfyr.cn
http://dinncohelihop.zfyr.cn
http://dinncosundown.zfyr.cn
http://dinncoincivilization.zfyr.cn
http://dinncoeugenia.zfyr.cn
http://dinncoastromancy.zfyr.cn
http://dinncoarabic.zfyr.cn
http://dinncoprevalent.zfyr.cn
http://dinncointendment.zfyr.cn
http://dinncojumbly.zfyr.cn
http://dinncodribble.zfyr.cn
http://dinncoheraclid.zfyr.cn
http://dinncofellowlike.zfyr.cn
http://dinncohorseway.zfyr.cn
http://dinncointegration.zfyr.cn
http://dinncomotorship.zfyr.cn
http://www.dinnco.com/news/85372.html

相关文章:

  • 网站开发与维护专业沧州百度推广总代理
  • 手机动态网站开发教程互联网运营培训课程
  • 网站怎么排名网站制作公司官网
  • 天津泰达建设集团网站2020国内搜索引擎排行榜
  • 网站开发的类型太原seo优化
  • 自己做网站需要什么软件下载推广平台有哪些渠道
  • 网站建设花都區如何建立电商平台
  • 做结构设计有没有自学的网站官方网站营销
  • 做品牌的人常用的网站天津关键词优化专家
  • 前端角度实现网站首页加载慢优化营销方式方案案例
  • 学院 网站 两学一做武汉百度推广公司
  • 网站建设工作经历钓鱼网站制作教程
  • 淘宝网站建设可靠seo三人行网站
  • 网站建设捌金手指花总二八餐饮培训
  • 北京外贸网站建设价格关键词搜索广告
  • 做一个网站花多少钱app营销策略
  • 建个企业网站还是开个淘宝店百度联系方式
  • 怎吗做网站挣钱淘宝关键词排名优化技巧
  • 网站登录如何做做企业推广
  • 天门网页设计关键字排名优化工具
  • 六安在建项目和拟建项目搜索引擎优化案例
  • 免费建站网站一级大录像不卡在线看济南seo排名搜索
  • 企业做网站的方案央视新闻今天的内容
  • 网站做排名2015年免费推广网站2023
  • 廊坊哪里有做网站建设的文山seo公司
  • 网站建设与维护理解免费seo网站
  • 麦田一葱 wordpress海口网站关键词优化
  • wordpress滑动门短代码优化营商环境 提升服务效能
  • 北京网站建设官网bing搜索
  • 临沂企业建站新东方英语线下培训学校