Jump to content

  • Log In with Google      Sign In   
  • Create Account

Lloydg

Member Since 15 Jun 2010
Offline Last Active Nov 05 2012 07:45 AM

Topics I've Started

Dynamically Create ModelMesh (MeshContent->ModelMesh)

03 October 2012 - 04:02 AM

I am having a problem, I want to Dynamically Create a ModelMesh at runtime rather then loading a file.

	    public static ModelMesh BuildMesh(String name)
	    {
		    MeshBuilder builder = MeshBuilder.StartMesh(name);
		    // build the mesh
		    MeshContent finishedMesh = builder.FinishMesh();
		   
		    return finishedMesh as a ModelMesh?
	    }

But I don't know how to convert a MeshContent to a ModelMesh?
Does anyone have an idea?

Thanks

Voxel Marching Cubes Questions

30 September 2012 - 02:32 AM

Hey everyone, I have a few things I would like some advice on before I start this project.


I want to build a voxel based terrain engine that can be dynamically altered. I have experimented with marching cubes before and made some meshes and such in OpenGL and C++ but only basic stuff.

My aims for what I want to do is is have the terrain optimized (my old stuff would slow down real fast), The map / terrain data needs to small and at some point hopefully be able to be streamed to clients.

The terrain needs to be able to altered by the user.

I will be using XNA 4.0

Okay, So the first question is about storing the terrain data / volumetric data... I think I should be using chunks and or an Oct tree.
Normally when I have implemented an Oct tree I have used it for collision and such.. But for the voxels I would be using it to save memory for example for large areas of the same id type like air.

Would I use just chunks? or chunks that each are a Oct tree?

With XNA how is the best way of dynamically creating the meshes for each chunk? Is a content pipeline the wrong way to go because it cant be used dynamically? MeshBuilder class cant be used dynamically from what I have read?

How should I store the terrain data? With XNA? if i want to stream it later will should it be in a SQL database of some sort?

Any help would be greatly appreciated!

Thanks in advanced, Lloyd.

Thread safe streaming objects into world

29 June 2010 - 05:41 PM

What i want to do is stream objects from a server into the world.

What i was thinking was doing something like this.

thread one is the Game's Main Loop:

thread two is the Streaming thread:

And how they interact is with a queue.

For the queue i was thinking of a std::vector<Object> queue;

So for the streaming thread, after it makes a new Object it would push it onto the queue. ( queue.push_back(newObject); )

And then in the thread one at the beginning of each frame it would do something like:
for (int i = 0; i < queue.size(); i++)
{
world->addObject(queue.at(i));
queue.erase(queue.begin()+i);
}

My question is: is this all thread safe? is this a good way of doing it? if not what is a good way?

Thanks heaps, Lloyd

Vector3f and Matrix4f Classes

25 June 2010 - 01:35 AM

Although I am not new to C++ or OpenGL, I am new to OpenGL in C++, I have done all of my passed OpenGL in Java using the LWJGL, In this it library it came with Vector and Matrix classes with methods like rotate matrix, cross vector, normalize vector.

Now i know how all these methods work.
I was wondering for c++ opengl using SDL should i write all these classes myself, or is there a library that should be used?

Is it worth writing these classes or is it just a was of time seeing its been doing 10000 times before?

If i should use a library what would you recommend.

Thanks a bunch, Lloyd

Storing a Complex Terrain

17 June 2010 - 10:59 PM

I want trying to get my head around how I should store a complex terrain.

Normal I would use a height map (just an array of heights) then generate cells that that would be have 4 values, each corner of the cell taken from the height map, then draw a quad or 2 triangles.

But I dont see how this can work for a more complex Terrain. One that could have multiple heights on one co-ords.

A example image of what i mean by complex terrain would be.
http://img153.imageshack.us/img153/2325/arches.jpg

I just dont know how i should store the data, then then generate the polys to draw it.

I have read something about "voxels" that have 8 values rather then 4.

Any information or anything and how this could be done would be really good.

Thanks, Lloyd

PARTNERS