How do you load...

Started by
4 comments, last by pheonix2468 18 years, 10 months ago
.raw or .wrl 3d models, ive tried finding tutorials on google but couldn't find anything. I want to laod a .raw or .wrl model into my opengl scene but can't find anything. Could someone help, directions to tutorials or source code would be much appreciated. Thanks in advance -=Pheonix2468=-
Advertisement
A .raw file can be absolutely anything so there is no way of loading it and it making sense, unless you know what program wrote the .raw file and what context it holds. As an example, the .raw file could hold byte values that represent colours, equally though, it could be a list of floating point numbers that represent water height levels. Either use is 'correct'.

I presume you mean .wrl in the context of VRML. I don't have any experience with this to help you I'm afraid. A quick Google yeilds this document, which seems helpful.

Good luck!
--
Cheers,
Darren Clark
If you need format specifications, Wotsit is your friend ;-)

Here's a link to the format specs (VRML) you're looking for
Killers don't end up in jailThey end up on a high-score!
Thanks guys there very helpfull. The .raw is exported from blender if that helps.
Ive found also deep exploration by right hemisphere. It converts laods of different file types into loads of others. i had a look at the c++ opengl export and wondered if i could use that, but there is alot of code for one model would i have to make a new .cpp and include that in the main .cpp??
Also is there a free program wich does the same as deep exploration??
By looks of it, you seem to be wanting to load in models for your program. Taking this assumption, you have a few options open to you. You could use an existing model format and abuse it for your needs or you could devise a model format of your own.

The benefit of using your own model format is that there is no superfluous information and it will fulfil your exact requirements. The drawback to a custom format approach is that it is quite involved and can be a bit of a head masher at times.

If you want to take the route of using an existing model format and abusing it then this is potentially a great deal easier to implement. There are two main kinds of model format that are in use these days, vertex-frame based models and skeletal models.

A vertex-frame based model stores a series of frames of animation and in each frame is contained the vertices for that frame. This means the model needs very little CPU horsepower to animate but does contain a lot of data for animation. A good example of this model format is the .md2 models that are used in Quake II.

The skeletal approach is to store the vertices only once and then attach 'bones' to them. The bones are then animated and the attached vertices are moved along with the bones. Skeletal animation uses a lot less space than vertex animation but the price is that there is a lot more demand on the CPU. As an example, Half-Life 2 and Milkshape 3D use a skeletal format.

One thing you must remember is that unless you are using the model in pretty much the same circumstances as it was designed for, it will contain some redundant data that you won't need.

Your .raw file that is exported from Blender can probably be loaded. You'll need to look for the file specification for it, try Google or, as mentioned by nife previously, Wotsit.

I've heard of Deep Exploration but never used it so I can't really comment. Perhaps someone who knows will be kind enough to discuss this.

As a side note, a .wrl file is not really a model format by looks of it, it appears to be more like a scene graph that describes a world/level. I'm not familiar with VRML so this is just a guess though.

In conclusion, your best bet would probably be to use an existing format and work around its limitations. Two formats that seem to be popular are Quake II's .md2 format, discussed here, or the .ms3d Milkshape 3D format. Brett Porter has an example of code to load a .ms3d over here. Be aware that this code is not mantained any more though.

I hope some of this was helpful to you and I wish you well on your coding travels :)
--
Cheers,
Darren Clark
Thanks eschen and thanks nife rateing++ for you two

This topic is closed to new replies.

Advertisement