I'm not sure where this post fits, but after staggering here and there I Thought I would throw it here!
I find difficult to make coordinates by hand (Not very good at x-y-z though I know the XY coordinate). Is there a tool that will allow you to draw let say a cube and it will give the coordinates for you? I use Ubuntu, but I will not mind if there is windows version!
Thanks

Dani AI

Generated

A compact, practical workflow that avoids hand-calculating XYZ for simple primitives is to use a modeller (Blender or FreeCAD) or a tiny script-modeler (OpenSCAD) to place a primitive at the world origin and either read the vertex list directly or export a mesh file and parse its vertex lines. This follows ’s suggestion of making geometry at the origin, and complements ’s pointer about higher-level toolchains by showing GUI and scripted options that produce exact coordinates ready for OpenGL. (docs.blender.org)

Blender (cross-platform, available on Ubuntu) is convenient for interactive placement and for exporting standard formats. Workflow: create a cube, set the object origin to (0,0,0), apply transforms so the mesh vertices are in object space, then either export Wavefront OBJ or read vertex coordinates from Blender’s Python API. A minimal Blender console snippet to print world-space vertex coordinates is shown below (works in Object mode; Edit-mode meshes should be updated first):

import bpy
obj = bpy.context.active_object
mesh = obj.data
for v in mesh.vertices:
    print(obj.matrix_world @ v.co)

The same basic approach — programmatic creation and exact coordinates — is available in OpenSCAD (scripted primitives, center=true centers a cube) and in FreeCAD (Part/Box creation and Python access to shape vertex lists). OpenSCAD is handy when exact numeric control is preferred; FreeCAD is good when a CAD-style parametric box and Python extraction are needed. (en.wikibooks.org)

When exporting, prefer formats that list vertex positions plainly (OBJ/PLY). OBJ files contain v lines for vertex coordinates and are easy to parse; Blender’s OBJ exporter also offers axis-forward/up mapping and “apply modifiers” options to control orientation and the exported mesh state — important when feeding coordinates into an OpenGL pipeline. Common pitfalls to watch for: differing “up” axes between tools, unapplied object transforms, unit/scale differences, face winding and normal direction; apply transforms and choose axis conversion at export time to avoid surprises. (loc.gov)

Recommended Answers

All 3 Replies

is a pretty useful tool to make OpenGL programming easier by providing lots of built-in functionality.But there are .

I'm not sure where this post fits, but after staggering here and there I Thought I would throw it here!
I find difficult to make coordinates by hand (Not very good at x-y-z though I know the XY coordinate). Is there a tool that will allow you to draw let say a cube and it will give the coordinates for you? I use Ubuntu, but I will not mind if there is windows version!
Thanks

What are you using in conjunction with opengl? Maybe it already has what you are looking for. For example, glut has glutSolidCube(length), where is places the solidCube in the origin. But if not then you could just make a simple function that draw what you want in the origin then transform it from there.

Sorry guys I have been out of coverage for a while. Thanks for your answers. Let me check your answers!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.