I use Balder engine to work with 3D objects. I have *.ase file which contain
*MAP_DIFFUSE {
*MAP_NAME "carrier_body"
*MAP_CLASS "Bitmap"
*MAP_SUBNO 1
*MAP_AMOUNT 1.0000
*BITMAP "//carrier_body.tga"
........
I've added my ase file and carrier_body.tga to resource of the project but when I load mesh from ase
var tank=ContentManager.Load<Mesh>("tanks_carrier.ase");
I've caught the exception:
There is no loader for the specified file type 'tga'
How right way to loading textures for ase file in Balder?
I passed the problem. Balder is not supported tga format for textures, I've used png texture and all worked nice.
Related
I have XML files, used on Unity in C#, imported from an Adobe Animate project. I want to create animate elements into Unity, so my question is, is that possible to do that ? Because of course, I searched a lot, and that's something only few people did, then how ?
Here, you have a short example of one XML file
<strokes>
<StrokeStyle index="1">
<SolidStroke scaleMode="normal" weight="3">
<fill>
<SolidColor color="#FFCC33" colorReferenceID="14"/>
</fill>
</SolidStroke>
</StrokeStyle>
</strokes>
<edges>
<Edge strokeStyle="1" edges="!-634 1767|-690 1566!-690 1566|-889 1509!-889 1509|-859 550!-859 550|-681 512!-681 512|-634 330!-634 330|-479 239!-479 239[-46 149 274 -38!274 -38|809 11!809 11[911 179 797 368!797 368[704 429 479 466!479 466|39 486!39 486|61 559!61 559
|1078 599!1078 599|1141 649!1141 649|1132 1729!1132 1729|1100 1767!1100 1767|560 1787!560 1787|545 1976!545 1976|-647 1951!-647 1951|-634 1767!-634 3369|-690 3570!-690 3570|-889 3627!-889 3627|-859 4586!-859 4586|-681 4624!-681 4624|-634
4806!-634 4806|-479 4897!-479 4897[-46 4987 274 5174!274 5174|745 5174!745 5174[911 4957 797 4768!797 4768[704 4707 479 4670!479 4670|39 4650!39 4650|61 4577!61 4577|1078 4537!1078 4537|1141 4487!1141 4487|1132 3407!1132 3407|1100 3369
!1100 3369|560 3349!560 3349|545 3160!545 3160|-647 3185!-647 3185|-634 3369"/>
<Edge cubics="!-634 330(;-634,330 -479,239 -479,239q-634 330 -479 239);"/>
</edges>
Format is not important, easiest way seems to convert this file into a SVG, but It can be a picture format.
I didn't try lots of things, once again I couldn't find examples of this problem, and what I wanted to do first is to create a "drawer", which create the csv using edges, and draw each edge directly on Unity.
The problem of this idea is the fact that I'll have all this elements drawn, but they will not be a unique element, movable.
I would create an Android App where I can show geo data and other things.
I implement Android.Gms.Maps and would change the default ping icon of a marker into an dot.
I tried different ways but nothing worked for me...please help me!
attempt 1: (Open the bmp icon from path)
_myPositionMarker = _map.AddMarker(new MarkerOptions()
.SetPosition(new LatLng(34.8094, 12.7484))
.SetTitle("Actual Position")
.SetIcon(BitmapDescriptorFactory.FromPath("C:\\Users\\my.name\\source\\repos\\repo\\appName\\Resources\\drawable\\dot.bmp")));
error message: failed to decode image, must be a bitmap
attempt 2: (I have included the bmp file as embedded resource)
_myPositionMarker = _map.AddMarker(new MarkerOptions()
.SetPosition(new LatLng(34.8094, 12.7484))
.SetTitle("Actual Position")
.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.dot)));
error message: the app did'nt compile but no failure is shown
attempt 3: (also as resource)
var markerImg = BitmapDescriptorFactory.FromResource(Resource.Drawable.dot);
_myPositionMarker = _map.AddMarker(new MarkerOptions()
.SetPosition(new LatLng(34.8094, 12.7484))
.SetTitle("Actual Position")
.SetIcon(markerImg));
error message: the app did'nt compile but no failure is shown
nothing worked! I have no idea to solve the problem :-/
to be sure...
_myPositionMarker = _map.AddMarker(new MarkerOptions()
.SetPosition(new LatLng(24.8094, 12.7484))
.SetTitle("Actual Position")
...shows the default marker correctly and the app work well
Thanks for helping!
Attempt 1 won't work as the path does not point at a path on the device itself.
Attempt 2 and 3 should work as long as the Drawable is not a VectorDrawable or XML based drawable. It needs to be an jpg or png.
These also can't be embedded resources, but have to be Android Resources, so they need to be in the appropriate Resources folder and Build Action set to AndroidResource.
Also make sure to add markers after the map ready callback has been called.
I use MagickNET in a ASP .NET application. Usually it's works but sometimes with somes files (.jpg, .png) I receive an exception when I resample the picture with another DPI
ImageMagick.MagickResourceLimitErrorException: iisexpress.exe: PixelCacheAllocationFailed `D:\Data\IT Tools and Applications\Code\Zola\ZolaIntranet\Upload\Temp\4ffe031b-b559-4b5c-8f88-e1a5b8e4fbe7.jpg' # error/cache.c/OpenPixelCache/3369
Here the line where the exception happens :
tmpImage.Resample(new PointD(300,300));
When I tried to use a smaller DPI (72 or less) I got another exception :
ImageMagick.MagickCacheErrorException: iisexpress.exe: UnableToExtendCache 'D:\Data\IT Tools and Applications\Code\Zola\ZolaIntranet\Upload\Temp\42458df9-f7ee-4e4b-abfd-628317b4b7eb.jpg': Invalid argument # error/cache.c/OpenPixelCache/3536 ---> ImageMagick.MagickCacheErrorException: iisexpress.exe: UnableToExtendCache
Can someone have an idea ?
For one or another reason, for few pictures in PNG format ImageMagick cant't find the density of the picture. You have to specify a density before calling Resample() function and that resolve my problem.
PointD density = new PointD(300,300);
tmpImage.Density = density;
tmpImage.Resample(density);
tmpImage.Write(image);
abstract
In the process of writing an unpacker for a IPK-archive (NDS Homebrew Image Viewer) I got stuck at the point where I had to decode single MCUs. The original Sourcecode indicates the usage of DCT but the reference implementation is all in ARM assembly...
I'm currently writing a rudimentary unpacker for the files utilized by NDS Homebrew "Image Viewer" (http://gamebrew.org/wiki/Image_Viewer).
The original site seems down but I found the source code (including a file format description) inside the archive hosted on gamebrew.
The unpacker is written in C# due to convenience (BinaryReader) and also because there is no need for it to be fast.
I've already managed to extract the thumbnails. Those are stored as deflated (zlib) BGR-Bitmaps.
The full-size images are split up into MCU's (8x8 samples). Each MCU is also stored in deflated form.
As of now I got the decompressed data with what seems like DCTed data. It also looks like they've "multiplexed" the individual channels (is this the 4:1:1?).
In the NDS version the byte data then gets passed together with a quantization-table (array of 64 signed 16bit-integers) into a function which looks like this:
void customjpeg_DecodeYUV411(s32 *pQuantizeTable,u8 *pData,u16 *pBuf)
{
pDCs=(s16*)pData;
pACs=(s8*)&pDCs[4*4*6];
static __attribute__ ((section (".dtcm"))) DCTELEM _y0[DCTSIZE2],_y1[DCTSIZE2],_y2[DCTSIZE2],_y3[DCTSIZE2],_cb[DCTSIZE2],_cr[DCTSIZE2];
TYUV411toRGB15_Data YUV411toRGB15_Data[4]={
{ NULL, _y0, &_cb[((4*0)*DCTSIZE)+(4*0)], &_cr[((4*0)*DCTSIZE)+(4*0)] },
{ NULL, _y1, &_cb[((4*0)*DCTSIZE)+(4*1)], &_cr[((4*0)*DCTSIZE)+(4*1)] },
{ NULL, _y2, &_cb[((4*1)*DCTSIZE)+(4*0)], &_cr[((4*1)*DCTSIZE)+(4*0)] },
{ NULL, _y3, &_cb[((4*1)*DCTSIZE)+(4*1)], &_cr[((4*1)*DCTSIZE)+(4*1)] },
};
// PrfStart();
// 3.759ms
for(u32 y=0;y<4;y++){
YUV411toRGB15_Data[0]._pBuf=&pBuf[((8*0)*64)+(8*0)];
YUV411toRGB15_Data[1]._pBuf=&pBuf[((8*0)*64)+(8*1)];
YUV411toRGB15_Data[2]._pBuf=&pBuf[((8*1)*64)+(8*0)];
YUV411toRGB15_Data[3]._pBuf=&pBuf[((8*1)*64)+(8*1)];
for(u32 x=0;x<4;x++){
DCT13bit_asm(pQuantizeTable,_y0);
DCT13bit_asm(pQuantizeTable,_y1);
DCT13bit_asm(pQuantizeTable,_y2);
DCT13bit_asm(pQuantizeTable,_y3);
DCT13bit_asm(pQuantizeTable,_cb);
DCT13bit_asm(pQuantizeTable,_cr);
YUV411_13bit_toRGB15_asm(YUV411toRGB15_Data);
YUV411toRGB15_Data[0]._pBuf+=DCTSIZE*2;
YUV411toRGB15_Data[1]._pBuf+=DCTSIZE*2;
YUV411toRGB15_Data[2]._pBuf+=DCTSIZE*2;
YUV411toRGB15_Data[3]._pBuf+=DCTSIZE*2;
}
pBuf+=(DCTSIZE*2)*64;
}
// PrfEnd(0); ShowLogHalt();
}
(taken from: customjpeg.cpp)
why are the calls run 4x4 times per mcu?
is it pure DCT? because i don't see where the "dequantization" is done and i've seen (afaik) some references to the zigzag-pattern(?) in the assembly..
am I missing something?
I've checked with some online resources, but they only seem to focus on the encoding process.
Unfortunately I lack the mathematical background, therefore I haven't grasped on to the full concept of DCT and thus the reversal process isn't as straight forward to me..
I've spent a whole day to get this running by utilizing libraries and C#-DCT implementations but I was unsuccessful.
I don't know exactly if it is a bug but i am getting all the time runtime IOException error saying Cannot locate resource.
I am loading some images in my app (c#, WPF) in canvas background depends on database state.
The problem is, that i cannot load LAST (alphabeting sorted) file. I have for example 15 images in folder. I can load 14 first without problems. But the last one all the time throw exception.
I am 100% sure, that i HAVE the image in the folder (see !image-printscreen below).
And how i wrote. 14 first i can load without any problem, only the last one throw exception.
Is it a bug in WPF-c# or am I doing something wrong?
code what is throwing exception:
canvas_status.Background = new ImageBrush(new BitmapImage(new Uri(BaseUriHelper.GetBaseUri(this), #"Images\" + statusName + ".png")));
canvas_name.Background = new ImageBrush(new BitmapImage(new Uri(BaseUriHelper.GetBaseUri(this), #"Images\" + statusName + bulheadName + ".png")));
error:
IOException was unhalded
Cannot locate resource 'view/images/panel_uzavreno_d.png'.
image (for higher resolution click on image right mouse button and click on SHOW IMAGE or something like that):
I've had a similar issue: IOException, cannot locate a png resource which indeed existed in the assembly.
I found the solution by explicitly specifying the assembly name, even though the caller was in the same assembly as the resource.
Here's how it looks with a Pack URI syntax:
pack://application:,,,/MyAssemblyName;component/MyResourcesFolder/MyImage.png
(For more about Pack URIs see http://msdn.microsoft.com/en-us/library/aa970069.aspx)
Edit: One more thing I had to do after specifying the assembly name was to Clean the project. The problem returns after build but was resolved after cleaning the intermediate products. This is definitely a bug in Visual Studio.
You need to set the build action of the image to the type 'Resource'.
Right-mouse click on the file >> Properties >> set 'Build Action' to 'Resource'