How to make a simple cad program

Blitz3D Forums/Blitz3D Beginners Area/How to make a simple cad program

rod54(Posted 2008) [#1]
Being a newbie this is probably a crazy question but here goes.

How would I create a simple 3D cad program that would let
me make a box for example

I would like to be able to manipulate the sides by moving a
point (vertex?) while showing me the distance I am creating
the side etc on the screen.


D4NM4N(Posted 2008) [#2]
Its possibly not the *best* for this, but if i was going to do it i would:

Try using a system of 3D pivots (see createpivot() function) as point references to use with the cameraproject() function. This will give you 2D screen coordinates you could use to easily create your own 3Dline() function. Use this to create (2d) lines between the points, but only those that have, or, are partnered with an on screen reference and are in camera range (- see entitydistance and entityinview functions)
Curves and things would also be a bit of a headache i reckon :D

The other way would simply to use the built in geometry functions to create boxes, spheres etc. in wireframe mode. Problem is you will see all the triangles too which maybe not what you want.

It could be a difficult project, especially if you are new to the language.


rod54(Posted 2008) [#3]
Thanks for the suggestions -- will research what you suggest and
see what I can figure out.

You would think they would have some 2d to 3d functions built into 3d languages to make it easy to do this but apparently not.


D4NM4N(Posted 2008) [#4]
How do you mean exactly, 2d to 3d?

There are ways to translate between both. For example. if i drew a line drawing on the screen, it would be fairly simple to say.. make walls in 3d from those lines (like the old doom level editor did if you ever used it)
The otherway around as i described above works too. (ie use 3d to effect 2d drawing coords)

Do you have a short 'design brief & specification'? It would be interesting to see what you are doing and perhaps we can give more advice on how to proceed :)


rod54(Posted 2008) [#5]
Well not show my ignorance :) but I would like to model a simple city block some what accurately to scale starting with the street and sidewalks
and then adding some simple buildings on it.

Working in wireframe I would be able to add a section of road and have the
screen display the dimensions of what I was making as I manipulated its
size by mouse movement for example.


Ross C(Posted 2008) [#6]
.


D4NM4N(Posted 2008) [#7]
Is it a project where you could model the city in a dedicated program and then just make changes? (Eg. is the editor just for your use for a sim or game?)

If so, do the main bulk of the modelling in autocad (or one of the many good free open source ones, or a 3D modeller) to accurately build the wireframe city then export this into B3D.
Once this is done it would be fairly simple to make a simple mesh editor you can alter/add to the mesh. However i reccommend reading up and experimenting with all b3d's mesh/surface/vertex/normal editing commands as well as the "pick" commands first before getting fully stuck in.

Blitz '3D units' can be used as a scale of 1:1 with your cad program or modeller making it 100% accurate.

However if this is to be a fully functional cad package (rather than just a tool to tweak & change a large city mesh) then i fear this will be a really BIG project.


rod54(Posted 2008) [#8]
The Idea is mostly in my head at the moment and not a real clear picture as I am just starting out.

Your suggestions are very helpful so thankyou.

The editor would be basically a sim I would think .


andy_mc(Posted 2008) [#9]
Have you done any projects in Blitz3D yet? I'd start with something simple, such as a program to design a simple box, then add more boxes, then snap the boxes together, apply textures with the mouse, etc... build up the features from there.


D4NM4N(Posted 2008) [#10]
agreed, most of my simple experiments have turned into useful little "in house" tools when doing that. Keep good comments too, i cannot emphasize that enough.


Ross C(Posted 2008) [#11]
Yep, editors aren't the easiest start projects :o) I've restarted mine countless times, each time improving it, but never finishing it. That's a matter of will power though :o) And yes, comments are are must, hehe.


rod54(Posted 2008) [#12]
Thanks for all the feedback from everyone ... Yep just starting out and wanting to create a Picaso but only having the ability to almost make a stick figure at the moment.

Much appreciated ..