can any1 teach me how to put a mark on my 3d model?and how can i save it?
when i try to view my model it took like half an hour to view the model. i think maybe it because of the model large size(43.7mb).do you guys know how to make it more faster?
HI mars, I think is a bigger model in the weigth, probably you can watch but if you tray to move rotate, the FPS will down very much.
When I make something in 3D, I divide the model or scene in parts, triying to modeling whit the minus polygons how as posible.
I stay making probes and about 3000 4000 polys whit textures of 1024*1024 runs fines, above 5000 polys the geometry turn a bit more slower.
Best regards,
Iván J.
PS:Think what, in example, models about 2Mb of weigth, in my iPod took aboout 35 40 seg to view a geometry with textures , a model of 40Mb is very hardest, and you have in mind, if the application goes to Apple Store, the limit what are beetwen standard for apple aprobe the app, is about 40MB 50Mb (this is commnent on Unity Forums), you can see how work your iPhone whit the Application "Instruments" on your MAC.
Best Regards,
Iván J
hi ivan..
currently i develop the application on windows os and i hav no intention to use it on iphone or mac....im still new in GLBaisc actually just started using it about 3 weeks ago...and about the model.i hav no authority to change anythng...
ok, Mars, I think was confused, I thinked what do you want for iPhone.
Well I think is very heavy model, in PC, I don´t make probes in 3D
If you can´t touch the model, well, the unique solution,I can tell you, is and if you don´t modeler, or don´t know how to use a 3dsoftware, use some optimizer software, and try to reduce the mesh to the max without loose the basic geomtry.Whit this you can go down too much the size in bytes of your model (I hope).
Sorry but I don´t occurs nothing more.
Good luck,
Iván J.
I'm not a GLBasic guru - far from it, I'm just trying to get back into programming after years and years of not doing any - but I think that the more information you give, the easier people will find it to be able to help you.
For example - the model youa re loading. What file format is it in? If it's text-based rather than compressed binary, that might have a direct effect on the speed. What are you trying to load it INTO? A GLBasic program that you are writing, or the GLBasic "Convert3D" program, or...?
What EXACTLY do you mean by "putting a mark on it". This is unclear especially if you are not supposed to change anything. Do you mean changing a texture (so... if it's a model of a house, that would be like painting on a wall) or changing the 3D to contain some custom ID/Logo/3D glyph of your own, or "watermarking" the model in such a way as to be able to prove ownership/copyright in a court of law, but undetectable to people who might break the copyright and pass it around?
The more info you provide, and the clearer (less ambiguous) you are, the easier it will be for people to suggest possible solutions, or at least avenues to explore. IMHO :)
sorry...
the program is that it view a 3d model which is in my case it is a plane model.the model is create by another person(plane.3ds).so i convert the model to*.ddd by using the ac3d software.the program that i want to create is that to view an access the damage on the plane by putting a x-mark on the model to indicate that that part of the plane is damage. Right now the problem is that i cant put the mark on the plane and i dont know how to save the data...
OK. Well, I haven't had time to pull out a 3d Plane to illustrate this post with so bear with me.
I'm going to assume that you're not all that up on 3D models, so if you know more than I assume then this post will probably sound patronising - for which, apologies. You can skip the "early learners" bit by jumping to the bit labelled BACK TO THE POINT :)
3D models can contain a lot of data in a lot of different guises. for example, there's the basic 3D shape of the model. Vital, obviously, can't be done away with or ignored or worked around - it must be there. A lot of the other bits, however, can be done in different ways and it's very difficult (beyond my skill) to offer an all-ine "Oh, this is the wya you do it" for EVERY style/type of model. even every style/type of model made in the same program.
In your specific case, you have a plane that you want to "paint" a big red X on, as I understand it. That will either be very easy or very difficult, depending on how the model was made. The crucial issue comes from a problem that cartographers have known - somewhat in reverse - for centuries. If we study their problem, they have a somewhat spherical shape (the Earth) which needs to be flattened out in order to fit neatly onto a sheet of flat paper for people to look at cnd call "map". The problem is that an unwrapped shphere doesn't actually fit on a flat plane very well at all, without hugely stretching it in some parts and squashing it in others. Alternatively, the cartographer could perhaps have a lot of holes in the map - imagine flattening orange peel or apple peel onto a page and sticking it in place. But then there would be these strange gaps between bits of land and sea. to make it worse, the surface of the Earth isn't even smooth - it's all bumpy giving rise to the same problem at lower and lower scales too.
Cartographers have come up with a few specific and rather ingenious ways to display the Earth with the minimum distortion that they can manage (there isn't just one - the default "map of Earth" isn't that great, there are versions which improve/decrease the amount of distortion so that the overall size of countries/areas is more balanced).
With 3D models, there's a very similar issue in that there needs to be a way to place a texture - a 2D picture - onto the model in order to create the surface colouration of the model correctly - and it needs to be as distortion-free as possible (to make creating the texture as simple as possible and to make the results as realistic as desired). again, this often results in some distortion on the texture so that the texture does not look exactly like a photo of the model, but (at least) like a warped one. The way that the 3D model co-ordinates correlate to locations on the texture image is called "UV Mapping" (see the cartographer connection there?) and it's this mapping that makes answering your question... tricky.
BACK TO THE POINT - in the case of an airplane, the modeller could have done any one of several things. He might have NO mapping at all, and modelled the aircraft with incredible detail, such that each different "material" on the plane is modelled in a different virtual "material", and each piece is simply coloured e.g.
Glass - all the parts made out of glass use this material
WhiteMatt - all the parts made of white matt materials use this
WhiteGlossy - you're getting the point here.
If the modeller has done this, and there is no UV Mapping, then you are going to have a hard time putting a big red X anywhere.
Alternatively he/she may have used planar mapping - that is to say that perhaps a photo of the plane from left and right is just projected onto the side. Examine any bitmaps you have that came with the plane, if you see images like that then you should be able to paint an X anywhere you like, within reason.
Yet again they might have made the mapping on a small segment of plane - say an aisle/window segment of the fusilage - very detailed, but then "tiled" that over the length of the plane. In that instance putting an X next to one window would likely repreat the X over all windows...
Yet ANOTHER way they could have done it is to perform a cylindrical mapping of the plane, perhaps improving on the basic cylindrical mapping technique with some unwrapping and fudging about. If that's the case then again you should be able to spot that by looking at any bitmaps that you have for the plane and see if any of them look like a neatly flattened plane.
There are probably alternatives that I haven't thought of - but the upshoot is that without actually seeing the model, a fixed specific answer is going to be tricky. The only single answer I can imagine is that you produce a 3D model of an "X" to include in the scene with the plane, such that the X can be moved into position and sized appropriately.
I hope that's not too discouraging, sorry I didn't have time to try and draw any of it out (actually one of the reasons I'm here is to learn GLB well enough to make some tools that might help me explain some of these issues better!)
Here's a quick video/animation showing how a 3D cube might be mapped to a flat plane for drawing on. Throughout this animation the cube is rendered using the texture bitmap that is actually shown in the last frame, as the box "unfolds" to lay itself out onto a flat plane to visually demonstrate how the 3D and 2D link together.
(http://i51.tinypic.com/33er3iu.gif)
Obviously, even a sphere would have a much more complex texture bitmap, with either a lot of stretching or a lot of "tears" as the model is flattened. An aircraft is considerably more complex than a sphere, so it's VITAL to know how the aircraft was constructed in order to answer how to paint a mark on it :)
Please accept my apologies if any of this is considered a bit low grade - I myself am quite visual, so I learn a lot more by "seeing" than by "reading".
tq for the information...i think i have a view on how to do marking...
but when we export the 3ds file format to *.ddd file the texture is change right cliff3d??
is there any way or a software that can help me keep the texture or create the texture file from the model(*.bmp) after i export it ?
currently im using AC3D to export the file....
and if you havent had time to pull out a plane maybe you you can just show me with just a simple 3d object( such as sphere or donut)...
The texture certainly should not change! The UV mapping should remain constant. I have not looked at the .ddd format yet - I prefer .OBJ as a 3D container so I am trying to write some .OBJ handling capabilities - but even if it does incorporate the bitmap texture, that would simply mean you have to paint/mark the x on the bitmap before converting to .ddd?
How do you see the workflow - are you hoping to write a program that will let the user place an X on the model at runtime, at will?
Most other issues really hinge on the way the model is built - the way the UV Mapping has been done is CRUCIAL. trying to respond is like trying to tell you how to raise a lifeform without knowing if it will be an amoeba, a daisy, or a lion (or indeed one of the other of the millions of lifeforms around).
If the plane has more than one bitmap associated with the texture then - you currently have no choice but to change the model. Because the only 3D format I am aware of GLBasic supporting at present - .ddd - does not support multiple texture files. There are some sortof good solid reasons for this if you consider GLBasic in light purely of writing games.
It really does come down to how the model is constructed - and I can't see that without seeing some files or at least some images of the model being worked on :(
Can you show us the UVMap?
As for painting on a texture map - tha tCAN be fairly easy. Look at the last frame of my little animation - that's a texture map. If you paint on a face then what you paint will show up on the sube seen in the first frame. Replace "f1" on the texture with "Cliff3D" and the cube will have "Cliff3D" on the front surface :)
yup...that is what i want to do.....
i try to upload the 3ds file but i failed each time i try..
Hmm....I'm not an expert on uploading or good sites to upload files to, but perhaps a different route? If you can make a UV Map you can show us the bitmap of that...
If you don't have any tools, uv mapper classic is free (and worth every penny) from : http://www.uvmapper.com/downloads.html
There are probably other free alternatives that are even better. You would need to save your file as a .OBJ for UVMapper and then load it into UVMapper and save a template as a .bmp, then convert THAT into a .png or .jpeg or .gif, and upload that for us to see. That wouldn't be as good as "the model" to decopher, but it might be better than nothing! :)
thanks for the info...
is this the texture file that usually use with the *.ddd file, cliff3d?
this is the uv map of the plane
[attachment deleted by admin]
Thanks for that UV Map - that greatly clears things up and makes it easier to give specific answwers that are a bit less...wooly :)
Quote from: mars_chaos89 on 2010-Sep-08
is this the texture file that usually use with the *.ddd file, cliff3d?
No, that is a "texture map". Imagine your aircraft is a plastic model kit, but instead of painting it you have to colour it JUST by applying stickers. Hopefully stickers which are included with the kit. The "texture Map" shows the layout that those stickers would have to be in order to fit the plane - if you paint on that texture map then you can apply it in GLBasic (or any halfway decent 3D program) to realise a textures aircraft. If this is the first bitmap you have seen associated with the plane then you may have a lot of work to do to fill in the other details!
As you seem to be just starting with 3D, you MAY find a 3D community (like the one at www.daz3d.com) to be quite helpful.
The manner of UV mapping used in your aircraft is quite clear now. To mark an "X" you would need a bitmap similar to the template - possibly created by painting over the template - and you'd paint you "X" to mark the spot.
Finding the relevant spot should be fairly easy, as the modeller has use the most simple, basic form of mapping - the whole aircraft is mapped using a split "plan" mapping. It isn't "unwrapped" - like my box example above - at all, it's just planar mapped from above and below.
HOW THE TEXTURE/BITMAP WILL APPLY TO THIS MODELOK, 3D novie. Hmmm.... imagine you have two lightbulbs - no, make that light panels, as long and wide as the plane. The plane is suspended with one light panel beaneath it, shining light upward, and one light panel above it shining light down. With me so far? Between each light and the aircraft was lay out a large sheet of acetate and draw our design on it - company logos, surface details which have not been modelled, and our "X marks the spot". Let's say we have a lot of sweeping "go faster" red lines. The light panels will project the colours from the acetates onto the top and bottom of the craft.
PROS
This mapping is very easy to do (it's a button click or two) and very easy to understand.
CONS
This mapping is as poor as it is quick. It causes problems. In this instance two leap out :
1. If your X is halfway down the side of the fusilage of the plane then part of your x needs to be on the top half of the template (the right-hand plane wireframe on your texturemap, I think) and the other part of your X will need to be on the matching part of the lower half. You may need a lot of trial-and-error to get these right if you do not use expensive 3D painting software. This problem is called a "texture seam", and the seam is placed in an awkward location - running down the left and right sides of the craft, from the looks of it.
2. Smearing is what we usually call the second problem this aircraft will suffer from. At the top of the plane - where the model is effectively parallel to the lightpanel in our example, the texture will transfer excellently from the image to the plane. However, the nearer we get to the side of the plane, the steeper the angle is between the plane geometry and the texture/acetate - until at it's shearest the plane's side is effectively at 90 degrees to the texture - at which point a single pixel-width of texture running down the texture map of the plane could convert into a several-feet-high smear on the model. Imagine the tail fin as perhaps the best example - there is no way to put a logo or "X" on there because the planaer top/bottom mapping simply does not allow it.
Now, I don't know the .ddd format, but I have quickly converted a .3DS aircraft to .ddd and judging by the file size it does not include the texture, no - so A texture bitmap would need to accompany the .ddd model. Personally, I would recommend that you remap the .obj version of the model to use planar mapping from left to right, split in half, rather than a top/bottom split, as this will make it easier to paint details on the side of the plane - but that is only a personal suggestion. I'm currently learning GLBasic myself - I'm on tutorial 10! - so I'm not familiar with much of its workings. The main thing I know about the .ddd format is that it does not hold models as complex as I would like, so I'm writing my own model import function. I'm pretty sure that there's a "3D model viewing" tutorial or example somewhere in the help though (check my sig for some useful tutorial sites) so I would advise trying that out to see how the aircraft actually looks with that texture map applied. Lots of trial and error, basically!
then how can i create the texture map cliff3d?i try using the uv mapper profesional...but it fail..
i get the general idea...tq..but how to put the 'X' mark on the model...
and where did u learn your tutorial...im also still learning GLBasic right now...
Quote from: mars_chaos89 on 2010-Sep-09
then how can i create the texture map cliff3d?i try using the uv mapper profesional...but it fail..
i get the general idea...tq..but how to put the 'X' mark on the model...
Terminology - the bitmap which UV Mapper Classic (and UV Mapper Pro) produce is a guide - it shows you WHERE to paint to achieve the desired result. For example, if I wanted a white plane with a blue cockpit/front/nose and red wings, I would paint over the while image in white, but paint over the wings (seen clearly left-and-right on both sides of your texture map) in red and paint over the nose (at the top, both left and right) in blue. Voila!
The texture map is a map or guide, on a bitmap, to how the modeller has created the link between 2D bitmap and 3D model.
You have UV Mapper Pro? Must be version 3.x... not what I'd recommend buying but there we go. Load the model up in that, and then load as a texture the bitmap you showed earlier. Switch to 3D view (probably by pressing the tab key) and you'll be able to see where the texture map fits the 3D model. UV Mapper is designed, to a degree, to allow you to edit a bitmap and then try it out on the 3d model using a seperate (ANY seperate) paint program. It's not as good as (say) 3Deep Paint, but it's a cheap/free alternative.
Quote from: mars_chaos89 on 2010-Sep-09and where did u learn your tutorial...im also still learning GLBasic right now...
GLBasic comes with a help file that has tutorials in it - and my sig links to the official online help file. I'm trying to update some fo the tutorials (#10 is done, am semi working on #1 now) for the Wiki, also linked to in my sig.
Well done Cliff, you've spent a lot of time and patience helping out this new user. Its good to see. :good:
Well - you know what they say. An eye for an... no, that's not right. What goes around..? No... Ah! Do unto others! (treat others as you yourself would like to be treated, or somesuch). Others have helped me - it'd be churlish to join a community like this and NOT offer some help to others, if I can. IMO :)
it just the demo that i downloaded...can i do it with the demo version?
when i try to convert the obj file to the *.ddd file this error occur..
Exception occured in command ddd_export_plugin
Last Error(not necessarily the problem): Not enough storage is available to process this command.
do you know anything about this problem?
or maybe you know where i can find some coding to directly read from -obj or other files typer such as 3ds without converting it.
i dont understand how to use the 3Dconvert in the GLBasic editor...can you teach me about this also?
sorry for asking toooo many question cliff3D because i only can read your answer the next day due to the area time zone...
getting tense everyday due to this problem...help me!!!
Hi Mars (and I answer fairly readily to just "Cliff" or sometimes even "Oi! You!" ;)
I'll answer your latest queries out of order using quotes for context, if I may :)
Quote from: mars_chaos89 on 2010-Sep-15sorry for asking toooo many question cliff3D because i only can read your answer the next day due to the area time zone...
getting tense everyday due to this problem...help me!!!
If you're getting replies (from me or indeed anyone else) then you probably have not asked too many questions. You seem to be in a slight pickle because you are approaching two different types of topic - programming and 3D - at the same time. As Gernot warns in his help file, learning GLBasic AND 3D at the same time can be...ah...taxing ;)
Try not to get stressed. I myself suffer from a few ailments - including one that is like having multiple appendicitis, so it's good to avoid stress. This community seems pretty helpful overall, so it shouldn't be anything but a pleasure to post here. Don't rush it. Ask as many questions as you feel like - the worst I can do is not have the time, inclination, or knowledge to reply - which isn't so bad. Practically stress free!
Quote from: mars_chaos89 on 2010-Sep-15it just the demo that i downloaded...can i do it with the demo version?
Certainly! The free demo version of GLBasic is all that I am using to evaluate the language, and it seems to have two modes:
1. Free for non-commercial "lite" use. This is the basic functionality and is free for personal use. I havne't looked into whether programs are distributable simply because I'm not at that stage with the language yet - just fiddling about really, not quite sure it's good enough for what I want.
2. DEMO mode if you use any advanced features. For example, 3D commands are advances features so the programs you compile will run with an on-screen "DEMO" watermark for about 5 minutes.
In my spare time I am writing a .OBJ (Wavewfront 3d model .OBJ) reader in the free/Demo GLBasic. Here's some samples of how well it's going so far:
(http://i54.tinypic.com/fjomq0.png)
(http://i51.tinypic.com/1zedo3d.png)
Quote from: mars_chaos89 on 2010-Sep-15when i try to convert the obj file to the *.ddd file this error occur..
Exception occured in command ddd_export_plugin
Last Error(not necessarily the problem): Not enough storage is available to process this command.
do you know anything about this problem?
It SOUNDS like you've not got enough hard drive space (or possibly memory, but hard drive space would be my bet) to save the .ddd model to - check for space on the destination and also temorary workspace drives/partitions.
Quote from: mars_chaos89 on 2010-Sep-15or maybe you know where i can find some coding to directly read from -obj or other files typer such as 3ds without converting it.
As mentioned above, I'm working on a .OBJ reader. It's going slowly because I'm only meddling about when I have free time. There's a slightly buggy version in the thread at: http://www.glbasic.com/forum/index.php?topic=4908.0 (http://www.glbasic.com/forum/index.php?topic=4908.0) which you could give a try to see if it will load the plane for you.
One of the major reasons I'm writing it is because I couldn't find any other support for .OBJ models. I'm afraid I don't know of any .3DS support as that file format interests me less :(
Quote from: mars_chaos89 on 2010-Sep-15i dont understand how to use the 3Dconvert in the GLBasic editor...can you teach me about this also?
Sadly, this is the area where I personally am weakest - *.ddd format files interest me even less than .3DS files, so the only time I have loaded up the converter has been in response to a post from you :(
However, if it's quitting with an error that does suggest either a problem with the model, the drive space available, or with the conversion process itself. Try my simple model viewer (don't forget to change the name of the texture in the source code) and see if that can read the .OBJ model in OK.
I've tried uploading a "Library" version of my current code at:
http://www.glbasic.com/forum/index.php?topic=4908.msg38735#msg38735 (http://www.glbasic.com/forum/index.php?topic=4908.msg38735#msg38735)
which works okish with single texture models (which I suspect yours is/may be) to produce on-screen imagery like this:
(http://i55.tinypic.com/2m4u35w.png)
from a .OBJ file (no file conversion to .ddd!). Beware! As I am still writing this, there could be all SORTS of traps for the unwary! I've also included code showing how to call the library and how to display the .OBJ model in 3D. Hope it helps!
tq for the obj reader cliiff...
i think you misunderstand something cliff...the demo version is not the GLBasic but the UVmapper professional...
its true that we easily get lost when trying to learn 3d and programming...
and i think i want to focus on the programming 1st because that is the only thing i can change right now
what i am trying to do is something like the one you showed me (the aeroplane example).but i need to add the 'x" marking and saving the data(where we mark at the model)....this is basically what im trying to do right now..
i downloaded your library but the extension is quite different from the other GLBasic file...so how can i use the library??
here is the snapshot of my program....
the x mark is there because i hold the left mouse button when i snap the image....
[attachment deleted by admin]
Quote from: mars_chaos89 on 2010-Sep-17
tq for the obj reader cliiff...
i think you misunderstand something cliff...the demo version is not the GLBasic but the UVmapper professional...
Ooops! Good, because I wouldn't pay that author for software again. But I digress. The UV Mapper Pro or Classic programs (Classic is free and unhindered but limited) can produce UV MAPS. I believe showing a current texture as you work on it is limited to the pro version - I use a v2 copy of Pro, so I'm not up to date with the software...but see below.
Quote from: mars_chaos89 on 2010-Sep-17what i am trying to do is something like the one you showed me (the aeroplane example).but i need to add the 'x" marking and saving the data(where we mark at the model)....this is basically what im trying to do right now..
i downloaded your library but the extension is quite different from the other GLBasic file...so how can i use the library??
Did Slydog's comments help you? I deliberately gave you a non-editable version of the library as it was then (it has since changes as I am working on it almost daily, to improve it) for a couple of reasons - one of which was to prevent you from getting bogged down in the way that the program loads the .OBJ data from the file.
As it's changed it'd be a bit of a PITA for me to try and reproduce exactly what you need to do, but SlyDog's comments looked good to me - you don't need to edit it, just to attach it to your project. the code you COULD see whould be in the main part of the project.
OK - I think I could do with being treate like an idiot. Or, well - a machine (there is a difference?). Could you outline for me EXACTLY what you need to do? For example, here are two versions tha tI could imagine from what you have shown - first what I originally interpreted as:
! need to be able to:
A)
1. Mark on a bitmap a red X where damage has occurred.
2. Load up an .OBJ model in memory.
3. Load the bitmap to "paint" the surface of the model.
4. Display the model on-screen, with the surface painted including my red "X".
5. Rotate and zoom the model at will to better see/illustrate the location of the X.
6. Goto 5
On seeing your latest image, I am concerned that it might be more like:
B)
1. Load up an .OBJ model in memory.
2. Display the model on-screen - possibly with an unmarked texture.
3. Rotate and zoom the model at will to be able to see any part of it
4. Move an "X" cursor to anywhere on the 2D screen to overlay the model.
5. Goto 3
or even....
C)
1. Load up an .OBJ model in memory.
2. Display the model on-screen - possibly with an unmarked texture.
3. Move an "X" cursor to anywhere on the 2D screen to overlay the model, and "Mark" it
4. Rotate and zoom the model at will to be able to see any part of it, with the marked "X" following the model.
5. Goto 4 (or 3 on request)
None of these are impossible - but C in particular could be a PITA, especailly without knowing more about the model construction. It looks like you may have an actual skeletal model of the airplane there? Based on the UV mapping as I've interpreted it, version C could really be awkward.
Is your "X" meant to be painted on the outside skin of an aircraft, or on the skeletal "innards"? Is it meant to be a free-floating 3D model of an "X" that you can place on the plane? (this would be harder on the program controller - perhaps - but easier to code). And so on - as much detail as you can give will help to understand how to aid you, I reckon!
Finally - writing a 3D object viewer without knowing much about 3D could be an exercise in bashing ones head against the wall - even without wishing to modify the model as well!
Thanks,
Cliff
sorry again for asking help without giving more details..ok..this is what i want to do...
1)Load a the plane model (dont mind about the file format actually...which one is easier?*.obj or *.ddd file?)
2)Rotate and zoom the model while put an 'X' on the model to indicate damage (for the time being lets try putting an 'X' on the outside skin of the model.
3)Save the data(where the marking is put on the plane) so that the user can view again whenever the user want.
maybe later i want put GUI for my program.....for the time being i just want to stick on the shortcut keys..
is it possible for me to do this using GLBasic?
Exception occured in command ddd_export_plugin
Last Error(not necessarily the problem): Not enough storage is available to process this command.
can this error occur eventhough i hav a 70GB free space...i thnk the prolem lies with the memory...
Quote from: mars_chaos89 on 2010-Sep-20
Exception occured in command ddd_export_plugin
Last Error(not necessarily the problem): Not enough storage is available to process this command.
can this error occur eventhough i hav a 70GB free space...i thnk the prolem lies with the memory...
I would report this as a bug/issue and hope it gets addressed.
tq clifff.....how about what i want to with my program?do you think GLBasic can support what i want to do??
this is the model in wavefront file...maybe when u see the obj file u can help me...im desperately in need of help...
Quote from: mars_chaos89 on 2010-Sep-20
Exception occured in command ddd_export_plugin
Last Error(not necessarily the problem): Not enough storage is available to process this command.
can this error occur eventhough i hav a 70GB free space...i thnk the prolem lies with the memory...
Did you tick the 21 Frame2 tick box when trying to convert? If you did not, the converter may have tried to convert your model into an animation, perhaps several hundred frames long...
How large is the .OBJ file? Perhaps the model is too large/complex?
Does the plane have a "skin" (the outer metal hull) or is it an internal structural model only? (it looks like the latter - which would probably be very difficult to paint an X on the texture map as nicely as you would like).
Quotetq clifff.....how about what i want to with my program?do you think GLBasic can support what i want to do??
I beleive GLBasic can probably do what you want it to do, given a PC with a good enough video card. That doesn't mean that it will necesseraliy be easy to get GLBasic to do it. The act of opening, viewing, rotating a 3D model and placing an "X marks the spot" would be easier in Poser or DAZ Studio (or Cinema4D or Lightwave or Hexagon or Wings3D or blender or...) than writing a bespoke program to do the job IMHO.
Quotethis is the model in wavefront file...maybe when u see the obj file u can help me...im desperately in need of help...
By seeing the actual .OBJ I mean I'd have to HAVE the actual .OBJ (and .MTL and any other associated files) to examine, poke with a stick, figure out what's not working. So far I've been working blind somewhat, and I can't see what I'm doing :(
If you can get .ddd files working (or just use DAZ Studio) then a lot of difficulties just go away :D
i hav the .ddd file but i dont have the texture image for that model...so is this what i need to do cliff?
:| i need to start from the .obj file again by creating the texture image using the uvmapper right?then convert?
(the obj file size is about 100mb.)
i already created the program to load the .ddd file and to zoom and rotate the plane model...
i hav been trying to send you the plane model.is there any way that i can send you the file privately?
i think it just the internal structure model...
Please let me annotate your post with numbers so tha tI can come back to the points in a slightly clearer manner than might otherwise be the case.
Quote from: mars_chaos89 on 2010-Sep-21
4. i hav the .ddd file but i dont have the texture image for that model...so is this what i need to do cliff?
5. :| i need to start from the .obj file again by creating the texture image using the uvmapper right?then convert?
(the obj file size is about 100mb.)
3. i already created the program to load the .ddd file and to zoom and rotate the plane model...
1. i hav been trying to send you the plane model.is there any way that i can send you the file privately?
2. i think it just the internal structure model...
Ah, I hadn't recalled that you were the chap who had a model that took half an hour to load! Seeing the model in .OBJ format (far larger!) I can see why my program "doesn't load" the model - the GLBasic demo times out at aboout 5 minutes, which will close my program before it has much chance to display anything very much. This is a GLBasic demo issue - the demo deliberately times out at 5 minutes, and I know of no way of overcoming that except purchasing the language.
Did GLBasic go up recently from aboout E60 to about E80? {blink}
Think of it this way - imagine you're in a toyshop looking for a toy model to approximate the level of complexity that GLBasic can handle. It's a large shop, so it has a Boeing 747 in different styles from different companies. First is a Fisher-Price "cute" plane, at the bottom of the accuracy/complexity range, followed by a Dinky die-cast metal toy, followed by an airfix plastic build-it-yourself model, all the way up to an ACTUAL boeing 747 in the carpark out back.
If your 3D model is an airfix kit (I would say it is higher up the scale) then GLBasic is designed to cope with perhaps the Dinky toy level, but the DEMO version of GLBasic only handles the Fisher-Price cute and cuddly toy level of 3D model.
This is not meant in any way to be derogatory towards GLBasic, the Demo version, or indeed Fisher-Price. It's just "what is". You don't go to a fast-food restaurant for a gourmet meal, and it isn't wrong to suggest that an expensive gourmet meal is better or more complex than a fast-food joint would provide.
OK - so, there it is. It is my belief that the DEMO version of GLBasic is not up to the job of displaying THIS model - as it currently is - using any of the "premier" features of GLBasic (like all the 3D routines). Let me respond to your post piecemeal first, then have some discussion about "where to go from here".
NUMBERED ANSWERS:
1. Ah, I have the plane model thankyou - and it shows me a lot, really helps understand the position you are in and hopefully discuss dealing with THIS specific model. It's over 100MB as a .OBJ file (.OBJ is a text-based files, so is not very compact).
2. Yes, it looks to be an internal structure kind of model. This complicates things somewhat, and helps to explain why the model is "not loading" in my program (it's loading, but GLBasic Demo is timing out before my program can convert it to .x and display it in OpenGL).
3. Excelelnt! This should save lots of heartache/trouble :D
4. I need to look at the model more closely than I can right now (I don't REALLY have time for this response as I have prep work to do for a bunch of kids I'll be teaching this afternoon, but I'm trying to be helpful) but there are a number of issues. The kickers are that the UV Mapping is not what you showed me (I cannot say without putting more time in - tonight perhaps, after classes) and neither you nor I have a full copy of GLBasic to take account of the amount of time it takes for GLBasic to load 3D models. The time available to work in and the UV Mapping MUST both be addressed first, before you even consider painting a texture. I personally would dump the idea of "painting" an X on the surface and use a 3D "X" model that can be scaled, rotated, and moved into place - because that will cut out a lot of work elsewhere that requires a better understanding of 3D than you currently seem to have.
5. Wow. 100MB. Unless we can reduce the complexity of the model somehow, you need the full GLBasic even to evaluate whether GLB will be good enough for you.
Ways to reduce the model complexity/load time MIGHT BE to save it as a .x (I have not investigated how long that would take, or whether it would save any time at all). I HAVE looked at it enough to know there are things to look at it that MIGHT offer some time savings.
Let me get back to you. This post is a stall (hopefully an informative stall) until I can look at things in another light, with more time. I want to post a new version of my code for testing, and do the prep work for my pupils this afternoon. If I get that done before lunch time I may be able to check on your plane problem a bit deeper.
Quote from: mars_chaos89 on 2010-Aug-30
can any1 teach me how to put a mark on my 3d model?and how can i save it?
when i try to view my model it took like half an hour to view the model. i think maybe it because of the model large size(43.7mb).do you guys know how to make it more faster?
Please, a quick question, are you using
X_LOADOBJ file$, num# to load the *.ddd version of the model? I can't think of anyything which would load that model, unmodified, into GLBasic as a GLBasic-recognised 3D model if you are :(
Will the loading take more than 5 minutes!? That can't really be, can it?
which loading?the application that i am working on?or the loading when the file is convert?
Quote from: Kitty Hello on 2010-Sep-21
Will the loading take more than 5 minutes!? That can't really be, can it?
Yes, very easily. I am slightly time constrained today, but I shall see if I can find some time reporting commands and time a few models on my E6600 dual core 2.4GHz desktop PC.
Quote from: mars_chaos89 on 2010-Sep-21
which loading?the application that i am working on?or the loading when the file is convert?
Loading the converted *.ddd into your program, the one you've written in GLBasic.
Right - I think I've got as much prep work done for the kids as I can, so I should be able to turn some attention to this. Thanks, mars, for the PM taking the pressure off me. I DO tend to try and push myself when helping others, as I don't know what your urgency/time pressures may be - so I try to be as timely as possible. Often beyond what is good for me. So no worries, I'll do what I can in the few minutes I have free now :)
SIMPLE CUBE (2KB ) Default texture
Timing:
.OBJ model and all textures loaded in 0 minutes and 0 seconds
.OBJ model in memory converted to .x in a further 0 minutes and 0 seconds
.x model shown on screen using X_DRAWOBJ and SHOWSCREEN for first time in a further 0 minutes and 0 seconds
SPACE RELIC: (3,639KB), 24 bitmaps for texture
.OBJ model and all textures loaded in 0 minutes and 17 seconds
.OBJ model in memory converted to .x in a further 0 minutes and 1 seconds
.x model shown on screen using X_DRAWOBJ and SHOWSCREEN for first time in a further 0 minutes and 0 seconds
HI-RES HUMAN MODEL (7,795 KB) Default texture
.OBJ model and all textures loaded in 0 minutes and 17 seconds
.OBJ model in memory converted to .x in a further 0 minutes and 13 seconds
.x model shown on screen using X_DRAWOBJ and SHOWSCREEN for first time in a further 0 minutes and 0 seconds
HI-RES MECH MODEL (7,887 KB) 16 bitmaps for texture
.OBJ model and all textures loaded in 0 minutes and 34 seconds
.OBJ model in memory converted to .x in a further 0 minutes and 6 seconds
.x model shown on screen using X_DRAWOBJ and SHOWSCREEN for first time in a further 0 minutes and 0 seconds
mars_chaos89's PLANE MODEL (100,906 KB) Default texture
.OBJ model and all textures loaded in 3 minutes and 18 seconds
...over 7 minutes after that the CPU as still working hard, but no resultss. I'll have to put some more debug detail in, though that will slow it down further :(
I have no experience with *.ddd files as they don't interest me at all, but if I get time I'll try to do some rough time test with them on the same files - using 3D Convert and X_LOADOBJ. Mars is free to beat me to it!
Obviously, this all runs MUCH slower on my netbook - I'm quite surprised at how fast the second step is when using a timer on my desktop (but then I mostly use my netbook I guess - and a watched pot never boils)
Timing of converting using 3D Convert is rather approximate, relying on human hand and stopwatch function of digital watch ;)
SIMPLE CUBE (2KB ) Default texture
Timing:
Instant!
SPACE RELIC: (3,639KB), 24 bitmaps for texture
10 seconds (seperate textures presumably lost)
HI-RES HUMAN MODEL (7,795 KB) Default texture
1 minute 3 seconds
HI-RES MECH MODEL (7,887 KB) 16 bitmaps for texture
26/27 seconds (seperate textures presumably lost)
mars_chaos89's PLANE MODEL (100,906 KB) Default texture
Over 40 minutes after reporting "Converting Frames (1)" the program has not visibly moved on. I am guessing it will take an hour or so to perform the conversion, and load times of the *.ddd will be relative to these conversion times.
I'll leave it running in case the created/modified file attributes can tell us anything later.
There are many ways to look at things. One can see a glass half full where someone else sees a glass half empty. Here, either the Demo of GLBasic is over too quickly (or runs too slowly) or the model is too large - it will depend who you ask. Personally, I feel the model is large and overly complex - but I don't know the final use properly, so perhaps it NEEDS to be that complex.
My point is, this isn't a "GLBasic sucks" post, or a "The Demo is too short" post. This is a "this is how long it takes" post. If I were mars, I would do exactly what I have actually done for my own (continuing) testing of GLBasic - re-evaluate the platform I am compiling on (VirtualPC is OUT!) and the data I am working with, and find a compromise that works, or at least proves the case. In mars' place I would probably be using a simpler - MUCH simpler! - plane model as a proof-of-concept. The downside to this will be if the model simply takes over half an hour minimum to load into GLBasic - would that be too slow for his application/clients? WARNING:- it doesn't load quickly into other applications either. This isn't a GLBasic-only issue... the model is BIG! Using a simpler plane model to start with sounds like a good plan, to me - though again, I don't know the project constraints. I can time it in a variety of other applications, but loading the basic data in and displaying it in 3D are two different things. I DO know that the basic project description sounds better suited to GLBasic than my own projects do, and I suspect GLB can do what I need well enough - so this seems a matter of finessing the data to suit the language to me.
post me the loading code, please. I think there is something trange going on. Loading a 5 MB file can't be that long.
It's not 5MB - it's 100MB as a .obj file. the conversion completed to .ddd while I was at school - it's 64,084 KB (over sixty MegaBytes)!
As I say, it's a pretty big and complex model, from the looks of things. It's not game-level 3D, it's higher end than that IMHO.
What "loading code" did you want? You have the code to 3D convert (sadly I can't tell from the file how long it took to actually convert to .ddd).
Here's some code for loading the .ddd files, and some timings. Note that as I am using the Demo copy of GLB I cannot load Mars' .ddd model because the program exceeds the 5 minute limit (and then some!) :(
// --------------------------------- //
// Project: TimeDDD
// Start: Tuesday, September 21, 2010
// IDE Version: 8.085
// FREE-VERSION:
// Need Premium for Features:
// 3D Graphics
// Network Commands
// INLINE C/C+++ code
SETCURRENTDIR("Media") // seperate media and binaries?
LOCAL starttimesec#, starttimemin# , starttimehour#, tempsec#, tempmin#, temphour#, seconds#, minutes#, hours#, FileName$
main:
FileName$=FILEREQUEST$(TRUE, "DDD filesJ|*.ddd|All|*.*")
SHOWSCREEN
starttimesec# = GETTIMERALL()
starttimemin# = GETTIMERALL()
starttimehour# = GETTIMERALL()
X_LOADOBJ FileName$, 1
tempsec# = GETTIMERALL() - starttimesec#
tempmin# = GETTIMERALL() - starttimemin#
temphour# = GETTIMERALL() - starttimehour#
seconds# = INTEGER(tempsec# / 1000)
minutes# = INTEGER(tempmin# / 60000)
hours# = INTEGER(temphour# / 3600000)
DEBUG ".DDD model loaded without textures in "+ minutes + " minutes / " + seconds + " seconds\n"
And the timings...
OK - some timings loading *.ddd files follows:
Same objects, but obviously they have lost all their bitmaps:
SIMPLE CUBE (1KB )
Timing:
Instant!
SPACE RELIC: (2,065KB)
.DDD model loaded without textures in 0 minutes / 6 seconds
HI-RES HUMAN MODEL (7,180 KB)
.DDD model loaded without textures in 1 minutes / 68 seconds
HI-RES MECH MODEL (3,758 KB)
.DDD model loaded without textures in 0 minutes / 17 seconds
Over 10 minute sin it hasn't finsihed!
mars_chaos89's PLANE MODEL (63,172 KB)
Over 15 minutes have passed and the CPU is still churning, but I've got to go have supper!
Maybe it will finish loading while I have lunch, though :D
It looks like it did - mars' model timing, from the program listed above:
.DDD model loaded without textures in 29 minutes / 1791 seconds
How many polys do you have at the "plane" - model?
According to Uv Mapper, the model has:
Vertices: 822,125
texture verts: 578,110
normals: 221,004
facets: 735081 (don't assume these are all triangles - they could easily contain some quads)
groups: 468
In addition I happen to know (having peeked) that each "Group" seems to be a seperate "Object" as well (but neither UV Mapper nor my OBJ import library for GLB support the "Object" command - at least, so far).
I'm going to try it without any UV data, and if that's a VAST improvement perhaps with planar mapping.
the time u load the *.ddd file model is around my time...it took like half an hour to load the model....
Quote from: Cliff3D on 2010-Sep-21
4. I need to look at the model more closely than I can right now (I don't REALLY have time for this response as I have prep work to do for a bunch of kids I'll be teaching this afternoon, but I'm trying to be helpful) but there are a number of issues. The kickers are that the UV Mapping is not what you showed me (I cannot say without putting more time in - tonight perhaps, after classes) and neither you nor I have a full copy of GLBasic to take account of the amount of time it takes for GLBasic to load 3D models. The time available to work in and the UV Mapping MUST both be addressed first, before you even consider painting a texture. I personally would dump the idea of "painting" an X on the surface and use a 3D "X" model that can be scaled, rotated, and moved into place - because that will cut out a lot of work elsewhere that requires a better understanding of 3D than you currently seem to have.
your suggesting me to load another 3d model(which is an 'X') rather than painting the model with x?that quiet interesting acutally...never thought of it...i will try to do it...
since im using a .ddd file format...didnt i should get my hand on it texture image?so how can can i get it?does uv mapper does the work?
i try to use the 3dconvert to covert the .obj file to .ddd file..still "converting frames <1>"
it took me about 1 and quarter hour to finish converting the model to .ddd file....
Quote from: Cliff3D on 2010-Sep-21
I'm going to try it without any UV data, and if that's a VAST improvement perhaps with planar mapping.
This did NOT help. At all :(
Quote from: mars_chaos89 on 2010-Sep-22your suggesting me to load another 3d model(which is an 'X') rather than painting the model with x?that quiet interesting acutally...never thought of it...i will try to do it...
Yes. I think that will get you a good-looking result without having to know a lot more about UV Mapping :) which is a whole disipline in and of itself.
Quoteit took me about 1 and quarter hour to finish converting the model to .ddd file....
Yeah - as I say, the model is too complex for GLBasic Demo, and if your clients/application cannot stand a wait of half an hour to load the plane, I would advise a lighter plane model - because GLBasic doesn't look likely to get much faster unless gernot has a seriously big surprise up his sleeves. Alternatively something like Deep Paint is specifically designed to let you paint things on the surface of 3D models.
Quote from: mars_chaos89 on 2010-Sep-22
since im using a .ddd file format...didnt i should get my hand on it texture image?so how can can i get it?does uv mapper does the work?
i try to use the 3dconvert to covert the .obj file to .ddd file..still "converting frames <1>"
*I* could, possibly, with a lot of work, figure out the existing UV Mapping or, more likely, remap the model (the existing uv mapping is a mess, frankly - it's possible that there is something meaningful hidden away in there and it only looks a mess because all the parts are jumbled in together, but that doesn't stop it from being an incomprehensible mess at present.
*I* could, with a huge (but probably lesser) effort, remap the model. Not as easily as the original plane modeller could, but these things can be done. You can remap it too, using UVMapper, but I doubt very much that the remapping would prove useful to you as a simple remapping - as you get from pressing just a few buttons in UVM - will leave large areas of the plane model inaccessible, and will cause ghost bits of "X" (or possibly entire X's) to appear on the model, AND will cause horrible smearing, where the shape of the X will distort.
It's hard to explain quickly and easily to anyone who doesn't already know the discipline of UV Mapping/model unwrapping, but IIRC I had a go the other day. Maybe showing an example would be better, but in the meantime trust me - a 3D model "X" is a better idea if you MUST stick with this plane model. If you can switch to a different model, choose one that has been designed to work well with texture maps. ;) and has fewer vertices/facets!!
Here's the model's UV Map. If we make changes in UV Mapper, that actually changes the 3D model. As you can see, right now it's a bit confusing/bit of a mess. I suspect that is because it is meaningless i.e. effectively "unmapped" - not suitable to the task. I could be wrong though, if each seperate object in the model is mapped seperately (IIRC there are over 400 "objects" in the model).
There's also an image of the model as a wireframe, in 3 orthographic views. From top-right going round clockwise let's call them "Front View", "Top View", and "Side View".
In the front view we can't see the sides or top and bottom, so we can't paint an X on them. In the top view we can't see the sides or the very front and back, so we can't paint an X on them. In the side view we get a great shot at painting on the side of the plane - but we can't see the top, bottom, front or rear so we can't paint on them.
I will also try to show how badly simplistic remapping will work, if you like, because it won't be ideal :( (but it will have to fit into time available)
A 3D "X" model is the way to go, with this plane.
[attachment deleted by admin]
ok...i will try to do a 3d "x" model to mark the plane...
That would be great (saves me trying to find time to illustrate texture smearing and seams).
BTW, is a load time of 30 minutes (ish) acceptable?
for the time being it is...
or you do have a way to decrease the time?
30 minutes?
yup...it took about 30 minutes to load the model that i'am using...
i had create the 3d 'X' model...but im stuck in calling 2 3d model on the same time...n how can i move the "X" around while not interfere the plane?
Quote from: mars_chaos89 on 2010-Sep-23
for the time being it is...
or you do have a way to decrease the time?
Not immediately, not without changing the model. If you can change the model, decimating it a bit to simplify it would speed up loading.
I don't have a tool on hand and ready that would decimate that large a model, but they can be bought/written (not the latter, by me) and studying the model more closely you might be able to select objects that are not required and simply delete them from the model.
Quote from: Scott_AW on 2010-Sep-23
30 minutes?
Yes. This has been the essence of much hand-wringing - the model that mars is using is larger than GLBasic was designed for, really. So it struggles a little bit. It makes it slightly harder to evaluate GLBasic with a model that takes 6 times longer than the demo period to load :(
Quote from: mars_chaos89 on 2010-Sep-23
i had create the 3d 'X' model...but im stuck in calling 2 3d model on the same time...n how can i move the "X" around while not interfere the plane?
Ahh... good question. I would assume you could call X_MOVEMENT then X_ROTATION then X_DRAWOBJ *for each object* in turn, they would move independantly of one another.
If you can't get that working, then define your "X" in code rather than as a .ddd, using an array of variables to hold the (x,y,z) co-ordinates. You can then manipulate the x,y,z co-ordinates in code before creating the 3d object using X_OBJSTART (but I think you'll find the first method works).
if key(50)=true then mark()
function mark:
x_loadobj mark.ddd, 2
x_drawobj 2,0
is this the correct coding?
im using if because i want the 'x' is load when the user want only...so when the program is start the user just find the plane model and load it.
Quote from: mars_chaos89 on 2010-Sep-23
if key(50)=true then mark()
function mark:
x_loadobj mark.ddd, 2
x_drawobj 2,0
is this the correct coding?
im using if because i want the 'x' is load when the user want only...so when the program is start the user just find the plane model and load it.
It depends on the rest of the structure of your main loop - you wouldn't want it to reload the "x" model every time through the loop, and you DO want it to show the X after the key has been released. But in essence yes, that's the flavour of it.
As you're not using the (messy looking) UV co-ordinates of the model, I plan on seeing if stripping out normal and UV data makes a .ddd that loads any quicker. Don't get your hopes up - it'll be a small improvement, I suspect, if any at all.
how can i load many 'X' without deleating the old 1...i still cant make the plane model and the 'x' to be call togther...
Quote from: mars_chaos89 on 2010-Sep-23
how can i load many 'X' without deleating the old 1...i still cant make the plane model and the 'x' to be call togther...
You wouldn't need to load many X's - keep an array of the position of x's and resuse the X ddd. Psuedo-code:
local numXs%=0, Xx#[],Xy[],Xz[]
mainloop:
draw plane
if numXs%>0
for temp% = 1 to numXs%
draw X
Move model
next
showscreen
goto mainloop
Something like that ought to do you?
Sadly 3D Convert makes the same size .ddd out of a .obj with no normals or uv - and GLBasic takes the same time to load it :(
But it was worth trying. 30 minutes looks like the best you're going tog et unless Gernot can speed up the 3d routines somehow.
The X's could even be just a square with "X" painted on it - it could be done all in code, no need for a .ddd if you wanted to go that way (I would use a painted texture on a square, myself).
Your function (mark) would want to REDIM the array of X,Y,Z co-ordinates and increase the "X" counter.
can i put this in a function( mark() )?
this is how i call for a new file...each time the user push[ ctrl+ n] they will be able to select a file to load...
function newfile:
SETCURRENTDIR( "./3d/" )
cmdline$=REPLACE$(cmdline$, "\\", "/")
splitpath(cmdline$,argv$[])
IF LEN(argv$[])>1
args$ = argv$[1]
ENDIF
filefull$=removequotes$(args$)
IF args$<>""
filename$= removeextension$(args$)
ELSE
filefull$=FILEREQUEST$(TRUE,"GLBasic .ddd, .dda, .ddw|*.ddd;*.dda;*.ddw")
filename$= removeextension$(filefull$)
ENDIF
starttimesec# = GETTIMERALL()
starttimemin# = GETTIMERALL()
starttimehour# = GETTIMERALL()
X_LOADOBJ filefull$, 1
usetexture=-1
IF DOESFILEEXIST(filename$+".bmp")
usetexture=1
LOADSPRITE filename$+".bmp", 1
ENDIF
IF DOESFILEEXIST(filename$+".png")
usetexture=1
LOADSPRITE filename$+".png", 1
ENDIF
endfunction
this is the function mark..where i want the user to push [m] button when they want to put the 'X'...so each time they push the button a new 'X' is appear but unfortunately i still stuck here....
function mark:
markfile$ = "xmark2.ddd"
X_LOADOBJ markfile$, 2
X_DRAWOBJ 2, 0
endfunction
this is as far i am writing the coding write for now....
is it possible to do something like this?
how to load two 3d model at the same tyme?
X_LOADOBJ "PLANE.DDD", 1
X_LOADOBJ "CROSS.DDD", 2
http://wiki.just-do-i-t.com/index.php?title=X_LOADOBJ (http://wiki.just-do-i-t.com/index.php?title=X_LOADOBJ)
ok tq cliff..then i try to draw the two object...i get the plane...but there is no cross appeared...
i try i simple coding to call the cross which is..
x_make3d 1,100000,45
x_loadobj "xmark.ddd", 2
x_drawobj 2,0
the model isnt appeared too...
is the problem lies in my coding or the model?
100000 for the far plane is way too much, too. Go as low as you can go to avoid z-fighting.
that is for my plane model...the model is big so it need that much z to be able to see it....
Quote from: Kitty Hello on 2010-Oct-01
100000 for the far plane is way too much, too. Go as low as you can go to avoid z-fighting.
Quote from: mars_chaos89 on 2010-Oct-01
that is for my plane model...the model is big so it need that much z to be able to see it....
The airplane model is huge - here's a quote from the model file itself:
Quote# Bounding box of geometry = (-19218.7,-16685.4,-7419.58) to (20802.8,12470.8,2988.05).
so in the tens of thousands in every direction.
Two things come to mind. Scale down the model prior to converting it to .ddd (I can help with this if needed). This will, of course, change the model.
Alternatively, perhaps the X_SCALING command will help - I can't display the plane in 3D at present because I am using the demo version of GLBasic, but I can use the X_SCALING command in general to resize the model I AM viewing. This might help you, and be quicker and easier. The following code uses my .OBJ model library as it currently stands just to get some scaling information from the model/s, but you should be able to see what's going on (I hope!). It also deomstrated viewing multpiple OBJects at once.
LOCAL modelheight#, modelwidth#, modeldepth#, modelxcentre#, modelycentre#, modelzcentre#
modelwidth#=MyOBJModel.maxX#-MyOBJModel.minX#
modelheight#=MyOBJModel.maxY#-MyOBJModel.minY#
modeldepth#=MyOBJModel.maxZ#-MyOBJModel.minZ#
myscale#=modelwidth#
modelxcentre#=MyOBJModel.minX#+(modelwidth#/2)
modelycentre#=MyOBJModel.minY#+(modelheight#/2)
modelzcentre#=MyOBJModel.minZ#+(modeldepth#/2)
IF modelheight#>myscale# THEN myscale#=modelheight#
IF modeldepth#>myscale# THEN myscale#=modeldepth#
myscale#=65.0/myscale#
LOCAL mousestatex, mousestatey, mousebutton1, mousebutton2
MOUSESTATE mousestatex, mousestatey, mousebutton1, mousebutton2
WHILE mousebutton1 + mousebutton2 <> 0
MOUSESTATE mousestatex, mousestatey, mousebutton1, mousebutton2
WEND
//glbeep(RND(205)+50,200)
WHILE mousebutton1 + mousebutton2 = 0
phi=phi+GETTIMER()/20
X_MAKE3D 1, 2500, 45
X_CAMERA 0,0, 120,0, 0 ,0
X_SCALING myscale#, myscale#, myscale#
FOR curXobject% = 1 TO numXobjects%
X_SETTEXTURE myTex%, myBump%
X_CULLMODE -1 // 0 = don't cull, 1 = only draw 'front', -1 = only draw 'back' (front and back as defined by GLBasic's interpretation of winding order)
X_MOVEMENT 0.0 - (modelxcentre# * myscale#) , 0.0 - (modelycentre# * myscale#), 0.0
X_ROTATION phi, 0, 1, 0
X_DRAWOBJ curXobject%, 0
NEXT
X_MAKE2D
PRINT "PRESS MOUSE BUTTON TO CONTINUE",140,460
SHOWSCREEN
MOUSESTATE mousestatex, mousestatey, mousebutton1, mousebutton2
WEND
Although I'm not using .ddd files but .OBJ files, the differences should be minimal. Note that I haven't fixed whatever my "centering" problem is, along the X and Y axes, but that shouldn't detract from being able to see how and where to put some scaling in to reduce the size of the airplane model "live" IMHO.
tq2 :booze:....i manage successfully load two 3d model but there something that making me confuse...
can i used x_movement together with x_scaling?
and is there an order that we need to follow in order to used this two command? such as we need to called x_movement 1st then can we call x_scaling....as far as i know and read we need to used x_scaling before x_rotation....
you can combime all of them. Just be sure to know that x_scaling and x_movement will drop any x_rotation. Thus, first scale/move then rotate.
tq2....how can i make the model to move and follow the mouse??sorry if the question confused you guys because i dont know how to ask this...
right now this is all i have achieved....
moustate x,y,mbr,mbl
if mbr=true
//i dont have any idea right now how can i write the coding here
endif
can you guys help me with this...
the mouse coordinates are 2D, the model is drawn in 3D. You need a Z- value for your mouse.
With X_SCREEN2WORLD you can transform the mouse position into 3D positions.
tq2....i will look at it immediately...
as im looking at x_world2screen..i saw another command which is x_screen2world...im a bit confused here...what is the different between this two command?and which 1 should i use?
Quote from: mars_chaos89 on 2010-Oct-06
as im looking at x_world2screen..i saw another command which is x_screen2world...im a bit confused here...what is the different between this two command?and which 1 should i use?
x_world2screen (http://www.glbasic.com/xmlhelp.php?lang=en&id=141&action=view) converts "x" 3D co-ordinates your program provides the function to 2D co-ordinates on the screen, plus "behind screen" or "in front of screen" data.
x_screen2world (http://www.glbasic.com/xmlhelp.php?lang=en&id=177&action=view)rather cleverly does exactly the opposite, converting 2D co-ordinates (plus "in front of" or "behind" screen) to 3D co-ordinates.
Note that, while the former should be very predictably accurate, owing to the way 3D maps to 2D and back again IMHO x_screen2world is subject either to further explanation or to being able to produce more than one result i.e. the answer it provides may not be the one you expect/need, despite being correct - because more than one 3D co-ordinate can be present (IS ALWAYS PRESENT!) at any given 2D screen co-ordinate. What makes one answer more significant - and worth reporting as "THE" answer - is unclear from the manual IMHO.
sory guys for bothering you all again....
i just want to ask for your opinion and suggestion....which 1 is better and easier?
option a:
-the user click on the any part of the model and the 'x' mark appear where the user click the button
option b:
-the user push a button and the 'x' mark appear anywhere and then the user can pick the 'x' mark to where he want it on the plane...
any suggestion or opinion?
Quote from: mars_chaos89 on 2010-Oct-06
sory guys for bothering you all again....
i just want to ask for your opinion and suggestion....which 1 is better and easier?
option a:
-the user click on the any part of the model and the 'x' mark appear where the user click the button
option b:
-the user push a button and the 'x' mark appear anywhere and then the user can pick the 'x' mark to where he want it on the plane...
any suggestion or opinion?
Option a is easier for the user and therefore "better" from that perspective. Depending on how (and how well) the X_SCREEN2WORLD (http://www.glbasic.com/xmlhelp.php?lang=en&id=177&action=view) actually works, this could be far harder to code.
Option b is easier to code (so may be considered "better for the coder" from a certain perspective) but requires more effort from the user.
From an overall perspective I would generally say that, if you can program it, the superior result is one that is easier/better for the end user (which would be Option a - if you can program it).
how can i know that the x_screen2world functioning properly?
Test it.
i have test the command and for the time being i just make the 'x' model to follow the pointer at the start of the program and it follow it...
i have an inquiry to ask....
i use x_movement after i use x_screen2world to make the model follow the pointer...but when i use the x_movement command my x_scaling did not work..it does not shrink the model...why is it happening?
i ahve try several ways to solve it but it still the same...
first :
x_movement mx,my,mz
x_scaling 0.2,0.2,0.2
x_rotation 90, 0,1,0
2nd :
x_scaling 0.2,0.2,0.2
x_movement mx,my,mz
x_rotation 90, 0,1,0
I don't know, I use your second example (scaling first, then movement, then rotating) and my models certainly do scale.
ok my bad.....it is being scale...sorry2 for bothering you.....
This is from the samples folder; mouse pointer to ray. :rtfm:
MOUSESTATE mx,my,b1,b2
X_SCREEN2WORLD mx,my, 0 , x, y, z
X_SCREEN2WORLD mx,my, -1, x2,y2,z2
ray=X_COLLISIONRAY(OBJ_BLOCK,0, x,y,z, x2-x, y2-y, z2-z) // smaller=closer
Quote from: matchy on 2010-Oct-07
This is from the samples folder; mouse pointer to ray. :rtfm:
MOUSESTATE mx,my,b1,b2
X_SCREEN2WORLD mx,my, 0 , x, y, z
X_SCREEN2WORLD mx,my, -1, x2,y2,z2
ray=X_COLLISIONRAY(OBJ_BLOCK,0, x,y,z, x2-x, y2-y, z2-z) // smaller=closer
That looks incredibly useful and applicable.
X_SCREEN2WORLD x,y,0, wx,wy,wz
IF mbl=TRUE
X_MOVEMENT wx,wy,wz
ENDIF
when i use if my application become like this :
the marking model is appear only when the left mouse button is hold and it disappear when i released the left button....
it does follow the mouse when it appear....
how can i do to make the model still there when i released the button?