Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Trevor

Pages: [1] 2 3 ... 15
1
General Anim8or Forum / Re: My rabbits for a low poly game Im doing
« on: May 31, 2021, 06:07:37 pm »
lol, "lo-poly" yet made with really smooth spheres, that's a contradiction.
As others have said and I will add, if you're going to use spheres, then you might as well add more detail to them.

They could also use some textures (which would help with the "lo-poly" side of things.

Trev

2
General Anim8or Forum / Re: UV Mapping, Lithunwrap and Blender
« on: May 29, 2021, 05:10:18 am »
specific to lithunwrap and an8 its even simpler.

Make model in an8
export as obj
open obj in lithunwrap
open bmp texture in lithunwrap (must be bmp)
do uv's (select best as stated above and tweek by dragging the points round your texture)
export obj
import obj in an8 and you will now see the uv's applied to model.
re-split model and delete original (Note, if you need to have a model split that comprises of multiple parts you can use Obj2An8 to save as .an8. there are also many features including snapping uv's to a grid or shading the model. using this method you want to import .an8 and again delete original)

Trev

3
I know an8 doesn't support vertex colours, that's why Im asking if it can be added. 8)

there are 2 variants of coloured obj files.
the most recent being that which I posted above, a normal obj but with 7 parameters for v (X Y Z R G B A) where RGBA are normalised 0-1. (presumably to allow HDR?)

the original method looks like this and is a little more complex (since it also has animation joints)
Code: [Select]
vt 0.199219 0.151367 0.0
vt 0.818359 0.151367 0.0
vt 0.818359 0.873047 0.0
v 875.500000 1808.016724 -0.117146
#joint 0
#vjoint 1
#vcolor 254.000000 254.000000 254.000000 255.000000
v 1050.500000 1808.016724 -0.117146
#joint 0
#vjoint 2
v 1050.500000 2100.016602 -0.117146
#joint 0
#vjoint 3
f 1/1 2/2 3/3
#fvcolorindex 1 1 1
...
so this format is using comments to allow more data interchange than the standard obj format.

#joint 0 refers to a previously set jointposition
Code: [Select]
#joint 0
#jointposition 962.500000 2015.016724 -36.117146
g Room02_primary
usemtl m0
vt 0.199219 0.151367 0.0
vt 0.818359 0.151367 0.0
vt 0.818359 0.873047 0.0
v 875.500000 1808.016724 -0.117146
#joint 0
#vjoint 1...

#vjoint is the vertex index and is the same as "weighted bones" except that each vertex is assigned wholly to a bone (using #joint n directly before)

#vcolor is the colour of the vertex with RGBA in 0-255 format (float could allow HDR maybe?)

#fvcolorindex is the same order as f but assigns the colour index (vcolor)

so;
v x y z
#joint n
#vjoint i
#vcolor r g b a

f 1 2 3
#fvcolorindex 1 2 3

However, I think that talking about file formats is a little superfluous at the moment since an8 doesn't yet support it.

My suggestion would be that if vertex colouring was found, they take precedence over material colour (diffuse) other material colours could still apply on a per-face basis.

Making an object could initially upon selecting the brush tool copy all currently assigned material colours to vertices.

As I say, the brush tool in figure editor would work well for vertex painting.

Backwards compatibility in older an8 would be hopefully to ignore any colours, however if this broke older an8 then a seperate colour file might work?

I again hope this can be done at some point :)
Trev

4
Hi Steve, been a while since its been asked but is, and if not can it be added, vertex colouring on your todo list?
You already have painting in the figure editor and it would be great if this could be ported to object editor.

I was sent a modified obj and luckily an8 still reads it which would imply that rgba could be read from it in the future since instead of just reading 3 entries ver pertex, you read 7 (I had thought that the modified obj format originally had the rgba in a comment, but its not)
v 1082.512451171875000 689.930297851562500 5735.037109375000000 1.000000000000000 1.000000000000000 1.000000000000000 1.000000000000000

many thanks and keep well,
Trev

5
Suggestion for next build - allow debug window to be closed without closing an8 (if a script requests the window to open allow it, and again, if user closes window dont close an8 too)

Trev

6
General Anim8or Forum / Re: Decal questiion
« on: January 15, 2021, 06:31:03 am »
I might also clarify that what steve posted was texture blending within a single material (i.e. you  cannot define seperate uv co-ords)
Given your example this would have been sufficient (a face on top of a solid colour) however if you want to apply an actual decal onto an already textured surface (say a cross on the side of an ambulance) then you need to use geometry decals (which you seem to have already demonstrated in your second pic)

This image back in 2009 I made by moving the decals off the hull by 1 unit.

Trev

7
General Anim8or Forum / Re: Decal questiion
« on: January 12, 2021, 05:10:33 pm »
An8 cannot do decals.
it does have a very good z-buffer and so making a separate decal object say 1 unit off the surface will work in "most" cases.

It would be good to allow co-planner faces to be defined as "decal" though (forcing on-top draw order)

Trev

8
oh, nice, I actually like the one on the left (youl probably tell me there both the same :P) :)

Trev

9
Ongoing Anim8or Development / Re: ASL issues
« on: June 24, 2020, 08:29:07 pm »
YAY, I managed to implement my own recursion in an8 script :)

this is the specific function;
Code: [Select]
int $ParseChildren(shape $Shape)
{
// Set up Stacks instead of normal vars
int   $si[0];
shape $sShape[0];
int   $Result, $i, $j;
shape $CurShape, $ChildShapes[0];

//Push Shape to stack
$sShape.push($Shape);
//Push Stacked Counter
$si.push(0);

$Result = true;

//While shapes are on stack and result is still true (No Fail)
while ($sShape.size && $Result)
{
//Get current shape
$CurShape = $sShape.pop;

if ($CurShape.GetKind() == SHAPE_KIND_GROUP)
{
//Recursion would happen here
// $ParseChildren($CurShape)
// however ...

//Get Children
$CurShape.GetShapes($ChildShapes);
$DebugPrint("getting Children " + $CurShape.name);

$i = $si.pop; //get last i off stack
$DebugPrint(PrintToString("getting i %d, stacksize %d ", $i, $si.size));

if ($i < $ChildShapes.size)
{
$DebugPrint("Parsing Children " + $CurShape.name);
//Has Children, traverse tree
$sShape.push($CurShape); //Push current Node to stack
$sShape.push($ChildShapes[$i]); //push next Node to stack
$DebugPrint("pushing child  " + $ChildShapes[$i].name);

if(!($StringContains($ChildShapes[$i].name, "BSP")))
{
$PrintTree.push("-"+$ChildShapes[$i].name);
for ($j = 1; $j < $sShape.size; $j++)
{
$PrintTree[$PrintTree.size - 1] = "\t|" + $PrintTree[$PrintTree.size - 1];
}
}


$i++;
$si.push($i); //Push(save) current nodes counter to counter stack
$DebugPrint(PrintToString("getting i %d, stacksize %d ", $i, $si.size));
if ($ChildShapes[$i-1].GetKind() == SHAPE_KIND_GROUP)
{
$si.push(0); //Stack new counter
$DebugPrint(PrintToString("accidental infinit group? getting i %d, stacksize %d ", $i, $si.size));
}
}
else
{
$DebugPrint("end of branch");
//reached end of branch
$C_File.print("/*\n");
$C_File.print("* Group: \n");
$C_File.print("*        Name      = %s\n", $CurShape.name);
$C_File.print("*        Objects   = %d\n", $ChildShapes.size);
$C_File.print("*/\n");

$C_File.print("static Gfx %s_dl[] = {\n", $CurShape.name);
for ($i = 0; $i < $ChildShapes.size; $i++)
{
if ($StringContains($ChildShapes[$i].name, "BSP"))
{
$ParseBSPNode($ChildShapes[$i]);
}
else
{
$C_File.print("    gsSPDisplayList(&%s_dl),\n", $ChildShapes[$i].name);
}
}

$C_File.print("    gsSPEndDisplayList(),\n};\n\n");



}
}
else if ($CurShape.GetKind() == SHAPE_KIND_PATH ||
$CurShape.GetKind() == SHAPE_KIND_MODIFIER ||
$CurShape.GetKind() == SHAPE_KIND_TEXT)
{
/* No 3D mesh to output. */
}
else
{
//Print mesh
if ($StringContains($CurShape.name, "BSP"))
{
//Do Nothing
}
else
{
$Result = $GenerateArray($CurShape);
//$PrintTree.push( PrintToString("%s", $CurShape.name));
}
}


}
return $Result;
}

10
Ongoing Anim8or Development / Re: ASL issues
« on: June 18, 2020, 03:51:02 pm »
ok no probs

trev

11
Ongoing Anim8or Development / Re: ASL issues
« on: June 18, 2020, 03:13:23 pm »
Steve, would you be able to say if asl function recursion is possible and if so how long it might take to implement?
Just wondering because I would like to parse groups as groups and might have to make a workaround but obviously recursion would be great and an instant fix for my loop.

thanks,
Trev

12
Ongoing Anim8or Development / Re: ASL issues
« on: June 09, 2020, 05:48:30 pm »
I fixed and added some more "basic" functions above but would still prefer to se language support for them instead including ToUpper, Split, Join, casting (Int/Float), case insensitive attributes and quaternionToPYR

Trev

13
Wrong forum?

Should be in Dev Forum, but anyway, I concur and have been battling reference image disappearances for some time now. I usually just double click it and press OK and it fixes itself.

The problem manifests usually when pasting anything. Having the image in a locked layer does not change the fact.

Trev

14
ASL Scripts / Fast 3D Export (Beta) 0625
« on: May 10, 2020, 12:13:00 pm »
Here is an export plugin for Fast3D at source level.


Debug mode is enabled

ver 20200625 (Beta)
 
 
 
  Features:
  • Duplicate Vertex removal
  • Triangle Sorting
  • Flat Shading
  • Smooth Shading (Lighting only, An8 does not support Vertex Shading)
  • Lighting
  • Fog (Disables Vertex Alpha as N64 places Distance on Vertex Alpha)
  • Texture Mapping
  • Environment Mapping
  • Bounding Box 
  • Bounding Volume Radius - Nothing Output Yet
  • Binary Seperating Plane (Partial Support with Tree traversal)
  • Groups and full hiearchy. Usefull for animation or part culling.   [/color]

 
  Supports:
  • Fast3D (16 vertex cache)(Default)
  • 4Tri   (GE/PD Fast3D Extension) 
  • F3DEX  (32 Vertex Cache, 2Triangles)
  • F3DEX2 (32 Vertex Cache, 2Triangles)   

  WishList:
  Portals (use mesh name "PortalA-B")
  Animations - Translate/Rotate
                        Needs flag IsAnimate else Pre-Calc matrix
                        using $point = $transformMat.Project($point);
 
 
 
 
  Attributes (Case in-sensitive):
    uCode    - Define EITHER a String Attribute with name "uCode" with:
                                             OR
                            Define an Attribute of ANY type with name:
                              Fast3D (default)
                              F3DEX
                              F3DEX2
 
    4 Triangles Extension - Define an Attribute of ANY type with name "TRI4_Ext"
 
    Vertex Cache Override - Define an Integer with name "VtxCacheOvr" (Not Recomended)
 
    Integer Vertices         - Define a Boolean with name "IntVtx" (Default False)
 
    Optimization Level    - Define an Integer with name "Optimize"
                                       0 None
                                       1 Sort Triangles           
                                       2 Trim Duplicate Vertices  (Default)
                                       3 Trim Vertices Aggressive (Not Recomended)
                                                   Ignore ST and RGBA, Force Integer Vertices
 
    Lighting              - Define a Boolean with name "G_LIGHTING" (Default false)
 
    Fog                      - Define a Boolean with name "G_FOG" (Default True)
 
    Auto Sun (Static      - Define a Point with name "AutoSun" (Default False)
          Vertex Shading)  X = Direction(0-360) (North = 0, East = 90 etc)
                                       Y = Azimuth (0-90) where 0 is the Horizon
 
Code: [Select]
  *   Ortho View
 *               90 Y+. Azimuth
 *                   /|\
 *                 .``|``
 *                '   |
 *               -    |
 *              .     |
 *                    |  S  180
 *             E 90   |  /
 *                 '-.|/`
 *           -      /` ```--..
 *           .    /`          ``--..     .
 *         0 .  /`                  ``--:.`.
 *           ./`                       :----' X+ W 270
 *       |'-.`
 *    Z+ ````` N 0
 
  Light direction is "Source" of light
    eg: The sun is in the south (180) at 45 High
 
 
 
 


Result C attached as txt

H
Code: [Select]

/*
* Export object "object01"
*
* Do not edit this file. It was automatically generated
* with Anim8or 1.01 Build 1.01.1378+
* from File "test.an8"
* Using uCode Fast3D
*/

#define G_CC_PASS1 0, 0, 0, 0, 0, 0, 0, 0
#define G_CC_PRIMSHADE PRIMITIVE, 0, SHADE, 0, 0, 0, 0, 1
#define G_CC_PRIMSHADEA PRIMITIVE, 0, SHADE, 0, 0, 0, 0, SHADE
#define G_CC_PRIMSHADEFA PRIMITIVE, 0, SHADE, 0, 0, 0, 0, PRIMITIVE
#define G_CC_SHADE2 PRIMITIVE, 0, SHADE, 0, 0, 0, 0, 1
#define G_CC_SHADE2A PRIMITIVE, 0, SHADE, 0, 0, 0, 0, SHADE
#define G_CC_SHADE2FA PRIMITIVE, 0, SHADE, 0, 0, 0, 0, PRIMITIVE
#define G_CC_MODRGB COMBINED, 0, SHADE, 0, 0, 0, 0, 1
#define G_CC_MODRGBA  COMBINED, 0, SHADE, 0, 0, 0, 0, SHADE
#define G_CC_MODRGBFA COMBINED, 0, SHADE, 0, 0, 0, 0, PRIMITIVE

#define LoadTextureBlock(ltbTextureName, ltbTextureImageFormat, ltbBitDepth, isDetail, width,    \
                         height, pal, cms, cmt, masks, maskt, shifts, shiftt)                    \
                                                                                                 \
        gsDPSetTextureImage(ltbTextureImageFormat, ltbBitDepth##_LOAD_BLOCK, 1, ltbTextureName), \
        gsDPSetTile(ltbTextureImageFormat, ltbBitDepth##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE,        \
                    0 , cmt, maskt,    shiftt, cms, masks, shifts),                              \
        gsDPLoadSync(),                                                                          \
        gsDPLoadBlock(G_TX_LOADTILE, 0, 0,                                                       \
                    (((width)*(height) + ltbBitDepth##_INCR) >> ltbBitDepth##_SHIFT)-1,          \
                    CALC_DXT(width, ltbBitDepth##_BYTES)),                                       \
        gsDPPipeSync(),                                                                          \
        gsDPSetTile(ltbTextureImageFormat, ltbBitDepth,                                          \
                    ((((width) * ltbBitDepth##_LINE_BYTES)+7)>>3), 0,                            \
                    G_TX_RENDERTILE+isDetail, pal, cmt, maskt, shiftt, cms, masks, shifts),      \
        gsDPSetTileltbBitDepthe(G_TX_RENDERTILE+isDetail, 0, 0,                                  \
                    ((width)-1) << G_TEXTURE_IMAGE_FRAC,                                         \
                    ((height)-1) << G_TEXTURE_IMAGE_FRAC)                                       

#define LoadMipMapTile(tmemoffset, rtile, ltbTextureImageFormat, ltbBitDepth, width,             \
                       height, pal, cms, cmt, masks, maskt, shifts, shiftt)                      \
        gsDPSetTile(ltbTextureImageFormat, ltbBitDepth,                                          \
                    ((((width) * ltbBitDepth##_LINE_BYTES)+7)>>3), tmemoffset,                   \
                    rtile, pal, cmt, maskt, shiftt, cms, masks, shifts),                         \
        gsDPSetTileltbBitDepthe(rtile, 0, 0,                                                     \
                    ((width)-1) << G_TEXTURE_IMAGE_FRAC,                                         \
                    ((height)-1) << G_TEXTURE_IMAGE_FRAC)                                       

/* Define Textures */

/*
 * Texture image format :
 *     G_IM_FMT_RGBA(RGBA format)
 *     G_IM_FMT_YUV (YUV format)
 *     G_IM_FMT_CI  (CI format)
 *     G_IM_FMT_IA  (IA format)
 *     G_IM_FMT_I   (I format)
 * Bit Depth :
 *     G_IM_SIZ_8b  (8 bits / texel)
 *     G_IM_SIZ_16b (16 bits / texel)
 *     G_IM_SIZ_32b (32 bits / texel)
 * S T Flags :
 *     G_TX_MIRROR  (enable mirror operations)
 *     G_TX_NOMIRROR(disable mirror operations)
 *     G_TX_WRAP    (enable wrap operations)
 *     G_TX_CLAMP   (enable clamp operations)
 */

/* Assign the corect values for brickdetail4colour Including any Mip-Map Tiles at end. */
#define BRICKDETAIL4COLOUR_Width  32
#define BRICKDETAIL4COLOUR_Height 32
#define BRICKDETAIL4COLOUR_MaskS  Log(BRICKDETAIL4COLOUR_Width) / Log(2)
#define BRICKDETAIL4COLOUR_MaskT  Log(BRICKDETAIL4COLOUR_Height) / Log(2)
#define BRICKDETAIL4COLOUR_DL \
    gsDPPipeSync(),                                                                                                  \
    LoadTextureBlock(&brickdetail4colour,                                                                                            \
                     G_IM_FMT_RGBA, G_IM_SIZ_32b, FALSE, /* Format, BitDepth, isDetail */                            \
                     BRICKDETAIL4COLOUR_Width, BRICKDETAIL4COLOUR_Height, 0,      /* Width, Height, PaletteID   */                                   \
                     S Flags, T Flags,            /* Clamp/Wrap/Mirror          */                                   \
                     BRICKDETAIL4COLOUR_MaskS, BRICKDETAIL4COLOUR_MaskT,          /* Pow 2 Bounds for flag, eg  use 5 for a 32x32 texture (5^2=32) */\
                     ShiftS, ShiftT),             /* Use G_TX_NOLOD             */                                   \
    LoadMipMapTile(0, 0,                          /* TMEM Offset, TileNumber    */                                   \
                     G_IM_FMT_RGBA, G_IM_SIZ_32b, /* Format, BitDepth           */                                   \
                     BRICKDETAIL4COLOUR_Width, BRICKDETAIL4COLOUR_Height, 0,      /* Width, Height, PaletteID   */                                   \
                     S Flags, T Flags,            /* Clamp/Wrap/Mirror          */                                   \
                     BRICKDETAIL4COLOUR_MaskS, BRICKDETAIL4COLOUR_MaskT,          /* Pow 2 Bounds for flag, eg  use 5 for a 32x32 texture (5^2=32) */\
                     ShiftS, ShiftT),             /* Use G_TX_NOLOD             */                                   \
  /* (From here, do LoadMipMapTile for each subsequent tile, eg a 32x32 usually has 6 tiles (0-5))                 */\


Trev

Edit 21:34, Added more draw commands
Edit 02:36, Added Triangle sorting, Auto Sun Baking, some other flags.
Edit 02:08, Added 4Tri and fixed VtxCache to batch by TnL changes and uCode limits (16/32 counts)
Edit 01:17, Added Tree traversal, Bounding boxes and named BSP support

15
Ongoing Anim8or Development / Re: ASL issues
« on: May 06, 2020, 05:41:18 pm »
Yes, all the more confusing as to why tridata only has 1 coloured vertex


Possibly my bad... I missed something from the obj plugin


Trev

Pages: [1] 2 3 ... 15