Menu

Library_autocubic.lua

Christian Walther Andrea Viarengo
Attachments
Ac20.jpg (10456 bytes)
Ac20b.JPG (13642 bytes)
Ac20c.jpg (29227 bytes)
Ac20shot.jpg (24813 bytes)
Ac20shot2.jpg (18831 bytes)
Forest.JPG (15140 bytes)
Textures.jpg (10330 bytes)

Introduction

Autocubic is a project which it will permit to build some simple 3D space directly into Pipmak, without the need to create every scene (or node) with external graphic program.

Autocubic use patches 3D placement added since Pipmak 0.2.7, but I have done also a version which run with old Pipmak 0.2.6 using only 2D patches and recreate the effect of 3D patches by means of a complex prerendered square and triangle images. If someone is curious, check the version 0.0.8 at the end of this page.

Of course the possibility of that system was very limited, but the result obtained was interesting (this demo works better with old Pipmak version 0.2.6, but it can works also in 0.2.7, there are only some visible gaps between patches, which were hidden in old Pipmak release)

The 3D version: the basics

Now I'm working on next release of Autocubic which will use the new APIs given by Pipmak 0.2.7.

The idea is to divide the space into a 3D grid that corresponds to a three-dimensional array.

Each individual element of the matrix describes how to draw the sides of the corresponding cell of the space.

In this way you can get the result shown in the following figures:

You can move in each cells of the space and pipmak recalculate the view from that point!

To make more realistic representation, Autocubic calculates (in a simple way...) also the brightness of the walls and the projection of the shadows...

The only things you have to do, is add some plain texture image files like these:

And a textual description of your space (I'm working to semplify the syntax of this description...)

Autocubic working demo

At the next address it's possible download the a demo (0.2.1) of new Autocubic:

http://andrea.viarengo.googlepages.com/ac21.pipmak

There still a lot of things to do, but:

  • the space 3D is fully navigable!!!
  • Shadows isn't perfect, but them can render the idea
  • Fog permit to limit the depth of field

What is missing:

  • algorithm to reduce number of patches (those hidden!!)
  • Better 3d map description (for now it's very hardy create a new map!!!)
  • Visual editor
  • brightness and color of the rooms
  • switches
  • links to other position/map/node
  • correct bugs...

History

0.2.1

  1. http://andrea.viarengo.googlepages.com/ac21.pipmak
  2. A lot of bugs corrected
  3. Doors and Windows have Front and Back side
  4. Doors could be opened
  5. Better map overlay view
  6. overlayed map is updated during movement (see NOTE below)
  7. Better fog managment
  8. Walls cannot trepassing
  9. Speed-up using lua image caching

0.2.0

  1. http://andrea.viarengo.googlepages.com/ac20demo.pipmak
  2. First version using patches 3D
  3. Doors/Windows aren't openable and have the same image for front and back
  4. Walls presence isn't checked (you can pass through the walls)
  5. Overlayed map doesn't work fine
  6. Control buttons doesn't work

0.0.8

  1. You can found it on http://viarengo.altervista.org/index2.html?page=download.html
  2. Patches 3D are emulated by 2D patches on faces
  3. previous version for Pipmak 0.2.6

NOTE: Bug in official Pipmak 0.2.7

There is a bug in 0.2.7: if you move in the space with the overlayed map open, Pipmak crash. This bug seems disapears with this workaround (I tryed only on WinXP):

  1. rename ac21.pipmak in ac21.zip
  2. uncompress ac21.zip into folder (maintaining subfolder paths)
  3. run Pipmak 0.2.7
  4. open main.lua inside folder

The problem should be resolved in build r205 I have prepared binary from SVN205 (sorry it's only for WindowsXP and probably doesn't work on VISTA)

http://andrea.viarengo.googlepages.com/Pipmak-r205-WXP.zip

Related materials

Forest generator demo

Another more simple example of new 3D Pipmak features using patch 3D placement could be the "Random Forest generator"

http://andrea.viarengo.googlepages.com/forest.pipmak

Forest generator is included into Autocubic.


_ - page created by Andrea Viarengo_


Related

Wiki: Main_Page
Wiki: The_Pipmak_Library_Project

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.