Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


PlatinumOz

Member Since 08 Sep 2012
Offline Last Active Feb 13 2013 01:51 PM

Posts I've Made

In Topic: Voxel structure programming implementation

13 September 2012 - 11:26 AM

First, render your model to a texture. Vertex shader:

// Authors : Sinje Thiedemann, Niklas Henrich,
//		   Thorsten Grosch, Stefan Mueller

varying vec3 P;

void main()
{	
   // Transform atlas texture coordinate into NDC
	gl_Position = vec4((gl_MultiTexCoord0.xy * 2.0) - vec2(1.0), 0.0, 1.0);

	// Pass world-space position to fragment shader
	P = (gl_ModelViewMatrix * gl_Vertex).xyz;
}

Frag shader:
varying vec3 P;

void main()
{
   // Store world-position in atlas texture
   gl_FragColor = vec4(P, 1.0);
}

Then, for each pixel, to something like this:
foreach pixel:
	addVoxelAtPosition(pixel.color);

Got it?

Man, I got it, thanks. But how can I use voxel data in program code? Do you read my question?
I asked about "c# structure class to store voxel data and be able for further using in code". Capish?

In Topic: Voxel structure programming implementation

13 September 2012 - 09:46 AM

Make sure your model has uv coordinates. Render your model to a texture. Set each vertex position to its vertex coordinates. Set each vertex color to its position. For each pixel, create a voxel at the position from pixel's color.

man, I don't catch what you have in mind! Could you show me class structure?

In Topic: Converting a 3D mesh model to a voxel field

13 September 2012 - 09:43 AM

The above 3 links all have public source code, is that useful?

Voxelizer is useful, but there is used octrees. I wish realization included arrays.

In Topic: Converting a 3D mesh model to a voxel field

13 September 2012 - 08:33 AM

Man, It will be good if you give any reference or fresh idea. Capish?

In Topic: Converting a 3D mesh model to a voxel field

13 September 2012 - 08:28 AM


Guy, thanks, but it's not exactly what I need.

Its exactly what you ASKED for.

You never gave us any indication of language, IDE, API or anything. You were given exactly what you asked for

Man, thanks, agree, It's now right of me. But take it easy man.

PARTNERS