Graphics3D library

derez

Expert
Licensed User
Longtime User
Following the http://www.b4x.com/forum/share-your-creations/3908-exercise-3d-rotation.html#post22546 I translated and improved it into a library.

There are two similar demo programs, for desktop and device. Start with the desktop and understand the functionality, then it will be easier on the device.

The attachment includes source (cs file to put in the libraries directory) and help in addition to the dll.

Ver 1.1 - addition of ZAxis method to change the direction of Zaxis, and improvement related to presentation of concave bodies. Desktop program is updated with more bodies.

Ver 1.2 - updates the drawing to use position in 3D and rotation in one method. Also GcCollect added to keep memory under control.
An example of how to display two objects with alternating order is added to the updated programs of the previous version.

Ver 1.3 - When doing multiple axes rotation at the same time the results vary with the order of rotation. This update enables selection of 6 different orders of rotation.
 

Attachments

  • Screen14.jpg
    Screen14.jpg
    47 KB · Views: 87
  • Screen15.jpg
    Screen15.jpg
    46.9 KB · Views: 67
  • Graphics3D Ver1.3.zip
    79.2 KB · Views: 134
Last edited:

derez

Expert
Licensed User
Longtime User
Ver 1.1 - addition of ZAxis method to change the direction of Zaxis, and improvement related to presentation of concave bodies. Desktop program is updated with more bodies.
 

Byak@

Active Member
Licensed User
very nice! first real 3d game on b4ppc cooming soon? =)
 

derez

Expert
Licensed User
Longtime User
first real 3d game on b4ppc cooming soon? =)

We are serious people, we don't play games here !! :cool:

But the attached update 1.2 is another step towards such things.

- edit - the update is updated to include the previous programs.
 
Last edited:

Byak@

Active Member
Licensed User
what about using image when drawing poligon?
 

derez

Expert
Licensed User
Longtime User
sorry, I don't understand the question.
Please explain what you need.
 
Last edited:

Byak@

Active Member
Licensed User
when we create 3d object we use other colors.can we use a bitmaps for this?
 

mjcoon

Well-Known Member
Licensed User
when we create 3d object we use other colors.can we use a bitmaps for this?

Perhaps an extension to that query: I wondered if there is any similarity (mathematically) to wrapping a bitmap around, say, a cylinder and rotating it?

I do understand that wrapping around a globe would be difficult because that introduces a projection!

Mike.
 

derez

Expert
Licensed User
Longtime User
when we create 3d object we use other colors.can we use a bitmaps for this?

I don't know how to put an image on a polygon. If there was something instead of FillPolygon - I could use it.

I wondered if there is any similarity (mathematically) to wrapping a bitmap around, say, a cylinder and rotating it?

The 3D bodies are made of vertices and the faces between them. Creation of a body which is made of curved planes is something completely different. An effect of a curvature can be done with gradient coloring but to put an image on a curved surface - I don't have a clue :confused:
 

derez

Expert
Licensed User
Longtime User
But some of the dat files are missing from v1.2 release (i.e. boom1.txt)

You are right, sorry. I changed in the devicedemo and forgot to update the desktop also to boom3. Although it is very simple to rotate and save a new file, I attach it here.
 

Attachments

  • boom1.txt
    358 bytes · Views: 7
Top