wavefront

Parse OBJ file with mixed data-types using Boost.Spirit?

不问归期 提交于 2021-02-08 06:17:15
问题 I do have an OBJ file that looks like this: # This file uses centimeters as units for non-parametric coordinates. # first element v -0.017050 -0.017928 0.005579 v -0.014504 -0.017928 0.010577 . . v -0.000000 -0.017928 0.017967 vt 0.397581 0.004762 vt 0.397544 0.034263 . . vt 0.397507 0.063764 vn -0.951057 0.000000 0.309016 vn -0.809017 0.000000 0.587785 . . vn -0.587785 0.000000 0.809017 f 1/1/1 2/2/2 21/4/3 f 21/4/3 2/2/2 22/3/4 . . f 3/5/5 4/7/7 23/6/6 # second element v -0.014504 0.017928

Is there a specification available for the Autodesk SVF format?

陌路散爱 提交于 2021-01-29 13:20:23
问题 I'm building a cross platform 3D viewing application in C#/C++ and would like to add support for Autodesk SVF files. I looked at Autodesk Forge but it has limited support for exporting to open formats such as OBJ, and Autodesk SVF does not appear to be the same format as the similarly named Simple Vector Format (http://www.svf.org/) as was stated here: https://forge.autodesk.com/blog/updated-little-more-detail-behind-autodesk-forge-apis-0 Is there a schema or specification available somewhere

How can I parse a simple .obj file into triangles?

巧了我就是萌 提交于 2021-01-29 05:32:07
问题 I'm trying to implement a ray caster and I'm starting out with simple .obj files (utah-teapot) and currently I only made classes for Spheres and Triangles, I basically have all the functions for the intersections, generating view rays, etc.. all ready but I just can't seem to be able to parse the .obj file into triangles (three vectors each) so I can have the ray casting possible on custom .obj files instead of just spheres. This is my current .obj file parser (didn't include the full working

Pyopengl reading obj file

て烟熏妆下的殇ゞ 提交于 2021-01-29 01:58:45
问题 I tried to read obj file with pyopengl but error come from glGenList(1) I just want to read the file and display in opengl Pls can you help me with full code; Am tired of stack and error it took me 3hrd to post this from OpenGL.GL import * from tkinter import messagebox import sys filename = input('pls input file path: ') class OBJ: def __init__(self, filename, swapyz=False): """Loads a Wavefront OBJ file. """ self.vertices = [] self.normals = [] self.texcoords = [] self.faces = [] material =

PyOpenGL how do I import an obj file?

北城以北 提交于 2021-01-13 09:59:33
问题 import pygame import OpenGL from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * import pywavefront scene = pywavefront.Wavefront('Handgun_obj.obj') vertices =( (1,-1,-1), (1,1,-1), (-1,1,-1), (-1,-1,-1), (1,-1,1), (1,1,1), (-1,-1,1), (-1,1,1), ) edges = ( (0,1), (0,3), (0,4), (2,1), (2,3), (2,7), (6,3), (6,4), (6,7), (5,1), (5,4), (5,7) ) colors = ( (1,0,0), (0,1,0), (0,0,1), (0,1,0), (1,1,1), (0,1,1), (1,0,0), (0,1,0), (0,0,1), (1,0,0), (1,1,1), (0,1,1), ) surfaces =

PyOpenGL how do I import an obj file?

☆樱花仙子☆ 提交于 2021-01-13 09:58:30
问题 import pygame import OpenGL from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * import pywavefront scene = pywavefront.Wavefront('Handgun_obj.obj') vertices =( (1,-1,-1), (1,1,-1), (-1,1,-1), (-1,-1,-1), (1,-1,1), (1,1,1), (-1,-1,1), (-1,1,1), ) edges = ( (0,1), (0,3), (0,4), (2,1), (2,3), (2,7), (6,3), (6,4), (6,7), (5,1), (5,4), (5,7) ) colors = ( (1,0,0), (0,1,0), (0,0,1), (0,1,0), (1,1,1), (0,1,1), (1,0,0), (0,1,0), (0,0,1), (1,0,0), (1,1,1), (0,1,1), ) surfaces =

Vtk inserts incorrect color between nodes when mapping texture to mesh

牧云@^-^@ 提交于 2020-06-17 07:20:54
问题 Hi I am trying to map a texture to 3d mesh using Mayavi and Python bindings of vtk. I am visualising an .obj wavefront. This obj is 3D photograph of a face. The texture image is a composite of three 2D photographs. Each node in the mesh has an (uv) co-ordinate in the image, which defines its color. Different regions of the mesh draw their colours from different sections of the image. To illustrate this I have replaced the actual texture image with this one: And mapped this to the mesh instead

Vtk inserts incorrect color between nodes when mapping texture to mesh

怎甘沉沦 提交于 2020-06-17 07:20:25
问题 Hi I am trying to map a texture to 3d mesh using Mayavi and Python bindings of vtk. I am visualising an .obj wavefront. This obj is 3D photograph of a face. The texture image is a composite of three 2D photographs. Each node in the mesh has an (uv) co-ordinate in the image, which defines its color. Different regions of the mesh draw their colours from different sections of the image. To illustrate this I have replaced the actual texture image with this one: And mapped this to the mesh instead

OpenGL - texture are mapped incorrectly using glDrawElements

南楼画角 提交于 2019-12-25 19:57:30
问题 I am creating an OBJ parser which reads the file and draw it using glDrawElements. The thing here is the model is correctly drawn but when I try to give it a texture, it is incorrectly mapped. I have read here that "OpenGL can only use one index buffer, whereas OBJ use one index buffer by attribute". I have also researched about the textures being incorrectly mapped when using glDrawElements and found out that I need to rearrange the textures because only vertices are shared but not the

Mapping Wavefront .obj texture vertex on OpenGL

给你一囗甜甜゛ 提交于 2019-12-22 06:56:01
问题 An artist gave me all 3D models for me exporting to .obj and .mtl in order that I can render it using OpenGL. But I can't figure out why the texture vertex are greater than 1 and sometimes negative. Take a look at this example: (...) vn -0.000717425 0.00106739 -0.00991695 vn 3.49779e-09 -5.22866e-09 -0.01 vn -0.00142294 0.00211706 -0.00966919 vn -0.00831486 -0.00555545 0 vt 5.82424 -20.091 vt 6.97527 -20.1873 vt 5.81848 -20.1618 vt -7.48189 8.29159 (...) He sent me all textures on TGA format,