简体   繁体   English

使用openGL在3D平面上显示SVG

[英]Display SVG on 3D planes using openGL

I have a requirement to draw different SVG files on respective 3D planes. 我需要在各自的3D平面上绘制不同的SVG文件。 For example, if I have two SVG files, I want to render them on two different 3D planes in openGL so that the planes can then have independent orientations in space. 例如,如果我有两个SVG文件,我想在openGL中的两个不同3D平面上渲染它们,以便这些平面可以在空间中具有独立的方向。 I tried using openVG for this purpose, but as I see, it only allows to use 2D transformations. 我尝试将openVG用于此目的,但正如我所见,它只允许使用2D转换。

Is there a way to do this in openVG or some other openGL based approach? 有没有办法在openVG或其他一些基于OpenGL的方法中做到这一点?

I would take the approach of rendering SVG to a texture, then map that texture to the 3d planes that you oriented in openGL. 我会采用将SVG渲染到纹理的方法,然后将该纹理映射到您在openGL中定向的3d平面。

Alternatively, you can wrap the root SVG visual with a perspective transform that does the equivalent 3D transform you want applied to each plane. 或者,您可以使用透视变换包装SVG根视觉对象,该变换执行要应用于每个平面的等效3D变换。

将SVG渲染为纹理,以所需的方向绘制纹理四边形。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM