working on it ...

Filters

Explore Public Snippets

Sort by

Found 112 snippets

    public by sherazam  184663  0  5  0

    How to Render an Image of 3D Model from the Camera inside .NET Application

    This Technical tip explains how .NET developers can render an image of 3D model from the camera inside their .NET applications. Using Aspose.3D for .NET, developers can render an image to view a realistic image of 3D model, with or without the enhanced background, textures, shadows and also adjust the image size. The Render method exposed by the Sc
    // Enter here the actual content of the snippet.            // this code example creates a camera in a 3D scene, sets its target and render an image.
    
    // [C# Code Sample]
    
    // For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET
    // The path to the documents directory.
    string MyDir = RunExamples.GetDataDir();
    
    // Load scene from file
    Scene scene = new Scene(MyDir + "camera.3ds");
    // Create a camera at (10,10,10) and look at the origin point for rendering,
    // it must be attached to the scene before render
    Camera camera = new Camera();
    scene.RootNode.CreateChildNode("camera", camera);
    camera.ParentNode.Transform.Translation = new Vector3(10, 10, 10);
    camera.LookAt = Vector3.Origin;
    
    // Specify the image render option
    ImageRenderOptions opt = new ImageRenderOptions();
    // Set the background color
    opt.BackgroundColor = Color.AliceBlue;
    // Tells renderer where the it can find textures
    opt.AssetDirectories.Add(MyDir + "textures");
    // Turn on shadow
    opt.EnableShadows = true;
    // Render the scene in given camera's perspective into specified png file with size 1024x1024
    scene.Render(camera, MyDir + "Render3DModelImageFromCamera_out_.png", new Size(1024, 1024), ImageFormat.Png, opt);
    
    //[VB.NET Code Sample]
    
    ' For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET
    ' The path to the documents directory.
    Dim MyDir As String = RunExamples.GetDataDir()
    
    ' Load scene from file
    Dim scene As New Scene(MyDir & Convert.ToString("camera.3ds"))
    ' Create a camera at (10,10,10) and look at the origin point for rendering,
    ' it must be attached to the scene before render
    Dim camera As New Camera()
    scene.RootNode.CreateChildNode("camera", camera)
    camera.ParentNode.Transform.Translation = New Vector3(10, 10, 10)
    camera.LookAt = Vector3.Origin
    
    ' Specify the image render option
    Dim opt As New ImageRenderOptions()
    ' Set the background color
    opt.BackgroundColor = Color.AliceBlue
    ' Tells renderer where the it can find textures
    opt.AssetDirectories.Add(MyDir & Convert.ToString("textures"))
    ' Turn on shadow
    opt.EnableShadows = True
    ' Render the scene in given camera's perspective into specified png file with size 1024x1024
    scene.Render(camera, MyDir & Convert.ToString("Render3DModelImageFromCamera_out_.png"), New Size(1024, 1024), ImageFormat.Png, opt)
    

    public by sherazam  2317  0  6  0

    How to Add Animation Property to 3D Scene Document inside .NET Application

    // Enter here the actual content of the snippet.            
    // [C# Code Sample]
    
    // For complete examples and data files, please go to https://github.com/aspose3d/Aspose_3D_NET
    // Initialize scene object
    Scene scene = new Scene();
    
    // Call Common class create mesh using polygon builder method to set mesh instance 
    Mesh mesh = Common.CreateMeshUsingPolygonBuilder();             
    
    // Each cube node has their own translation
    Node cube1 = scene.RootNode.CreateChildNode("cube1", mesh);
    
    // Find translation property on node's transform object
    Property translation = cube1.Transform.FindProperty("Translation");
                
    // Create a curve mapping based on translation property
    CurveMapping mapping = new CurveMapping(scene, translation);
                
    // Create curve on channel X and Z
    Curve curveX = mapping.CreateCurve("X");
    Curve curveZ = mapping.CreateCurve("Z");
                
    // Move node's translation to (10, 0, 10) at 0 sec using bezier interpolation
    curveX.CreateKeyFrame(0, 10.0f, Interpolation.Bezier);
    curveZ.CreateKeyFrame(0, 10.0f, Interpolation.Bezier);
                
    // Move node's translation to (20, 0, -10) at 3 sec
    curveX.CreateKeyFrame(3, 20.0f, Interpolation.Bezier);
    curveZ.CreateKeyFrame(3, -10.0f, Interpolation.Bezier);
                
    // Move node's translation to (30, 0, 0) at 5 sec
    curveX.CreateKeyFrame(5, 30.0f, Interpolation.Linear);
    curveZ.CreateKeyFrame(5, 0.0f, Interpolation.Bezier);            
    
    // The path to the documents directory.
    string MyDir = RunExamples.GetDataDir();
    MyDir = MyDir + RunExamples.GetOutputFilePath("PropertyToDocument.fbx");            
    
    // Save 3D scene in the supported file formats
    scene.Save(MyDir, FileFormat.FBX7400ASCII);
    
    //[VB.NET Code Sample]
    
    ' For complete examples and data files, please go to https://github.com/aspose3d/Aspose_3D_NET
    ' Initialize scene object
    Dim scene As New Scene()
    
    ' Call Common class create mesh using polygon builder method to set mesh instance 
    Dim mesh As Mesh = Common.CreateMeshUsingPolygonBuilder()
    
    ' Each cube node has their own translation
    Dim cube1 As Node = scene.RootNode.CreateChildNode("cube1", mesh)
    
    ' Find translation property on node's transform object
    Dim translation As [Property] = cube1.Transform.FindProperty("Translation")
    
    ' Create a curve mapping based on translation property
    Dim mapping As New CurveMapping(scene, translation)
    
    ' Create curve on channel X and Z
    Dim curveX As Curve = mapping.CreateCurve("X")
    Dim curveZ As Curve = mapping.CreateCurve("Z")
    
    ' Move node's translation to (10, 0, 10) at 0 sec using bezier interpolation
    curveX.CreateKeyFrame(0, 10.0F, Interpolation.Bezier)
    curveZ.CreateKeyFrame(0, 10.0F, Interpolation.Bezier)
    
    ' Move node's translation to (20, 0, -10) at 3 sec
    curveX.CreateKeyFrame(3, 20.0F, Interpolation.Bezier)
    curveZ.CreateKeyFrame(3, -10.0F, Interpolation.Bezier)
    
    ' Move node's translation to (30, 0, 0) at 5 sec
    curveX.CreateKeyFrame(5, 30.0F, Interpolation.Linear)
    curveZ.CreateKeyFrame(5, 0.0F, Interpolation.Bezier)
    
    ' The path to the documents directory.
    Dim MyDir As String = RunExamples.GetDataDir()
    MyDir = MyDir & RunExamples.GetOutputFilePath("PropertyToDocument.fbx")
              
    ' Save 3D scene in the supported file formats
    scene.Save(MyDir, FileFormat.FBX7400ASCII)
    

    public by Robertsim  1794  1  4  -1

    You can set up multiple alarms

    There are a couple of differences that apply to Free Alarm Clock but also I have now replied to your Alarm Clock concerns. Oh yes, today hasn't been a good day. It is easy to say what you mean when that details Free Alarm Clock so poorly. My Free Alarm Clock was appraised by them. It is a laugh riot for me how people must handle an understandable motif like this. 
    http://sourceforge.net/projects/freealarmclockremindersoftware/

    public by kla  189556  0  5  1

    VHDL component declaration

    COMPONENT componentName
    generic (
      generic1      : positive range 1 to 128;
      generic2      : positive range 1 to 16;
      generic3      : integer  range 1 to 32
    );
    port (
      signal1       : in  std_logic;
      signal2       : out std_logic_vector(0 to generic1);
    );
    END COMPONENT;
    

    public by kla  1903  0  5  2

    VHDL Component intantiation

    componentName_0: componentName
    generic map (
       generic1      => genericSignal1,
       generic2      => genericSignal2,
       generic3      => genericSignal3
    )
    port map (
       signal1       => topSignal1,
       signal2       => topSignal2
    );
    

    public by kla  3263  0  5  1

    VHDL Entity

    Example of generic VHDL entity
    ENTITY entityName IS
    GENERIC(
       generic1    : positive range 1 to 128:=4;
       generic2    : std_logic:='0';
       generic3    : integer range 1 to 32:=1
       );
      PORT (
        signal1    : IN  STD_LOGIC;
        signal2    : OUT STD_LOGIC_VECTOR(15 DOWNTO 0)
      );
    END entityName;

    external by davilamds  16  0  1  0

    Flip Flop tipo D con reset y eneable (2) VHDL

    Flip Flop tipo D con reset y eneable (2) VHDL: d_ff_en_2.vhd
    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    
    entity d_ff_en_2 is
    	port(
    		clk, reset: in std_logic;
    		en: in std_logic;
    		d: in std_logic;
    		q: out std_logic
    	);
    end d_ff_en_2;
    
    architecture arch_d_ff_en_2 of d_ff_en_2 is
    signal r_reg, r_next: std_logic;-- se utiliza señales intermedias para guardar valores futuros
    begin
    	process(clk, reset)
    	begin
    		if (reset='1') then --reset con prioridad
    			r_reg<='0';
    		elsif (clk'event and clk='1') then --cambio de clk=1 ejecuta
    			r_reg<=r_next; --registro=valor siguiente.  
    		end if;
    	end process;
    	
    	r_next<=d when en='1' else r_reg; --el valor siguiente=d si en=1, caso contrario es igual a r_reg
    	q<=r_reg;-- la salida es r_reg
    	
    end arch_d_ff_en_2;
    
    

    external by davilamds  13  0  1  0

    Flip Flop tipo D con reset y eneable VHDL

    Flip Flop tipo D con reset y eneable VHDL: d_ff_en_1.vhd
    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    
    entity d_ff_en_1 is
    	port(
    		clk, reset: in std_logic;
    		en: in std_logic;
    		d: in std_logic;
    		q: out std_logic
    	);
    end d_ff_en_1;
    
    architecture arch_d_ff_en_1 of d_ff_en_1 is
    begin
    	process(clk,reset) -- el proceso principal es disparado por clk o reset (proceso único)
    	begin
    		if (reset='1') then --reset tiene prioridad
    			q<='0';
    		elsif (clk'event and clk='1') then --luego si clk=1 sigue
    			if (en='1') then --si clk=1 y en=1
    				q<=d; --funcionamiento normal de ffd
    			end if;
    		end if;
    	end process;
    
    end arch_d_ff_en_1;
    
    

    external by Miguel Davila Sacoto  12  0  1  0

    Flip Flop tipo D con reset VHDL

    Flip Flop tipo D con reset VHDL: d_ff_reset.vhd
    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    
    entity d_ff_reset is
    	port(
    		clk, reset: in std_logic;
    		d: in std_logic;
    		q: out std_logic
    	);
    end d_ff_reset;
    
    architecture arch_dffreset of d_ff_reset is
    begin
    	process(clk,reset)--tanto un cambio en clk como reset disparan el proceso
    	begin
    		if (reset='1') then -- el reset tiene prioridad al ser asíncrono
    			q<='0';
    		elsif (clk'event and clk='1') then-- si no existe un reset y el cambio de clk=1
    			q<=d;-- funcionamiento normal del ffd
    		end if;
    	end process;
    end arch_dffreset;
    
    

    external by Miguel Davila Sacoto  24  0  1  0

    Flip Flop tipo D VHDL

    Flip Flop tipo D VHDL: d_ff.vhd
    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    
    entity d_ff is
    	port(
    		clk: in std_logic; --declaración de señal de reloj
    		d: in std_logic;
    		q: out std_logic
    	);
    end d_ff;
    
    architecture arch_dff of d_ff is
    begin
    	process(clk)--proceso toma en cuenta únicamente la señal clk
    	begin
    		if (clk'event and clk='1') then --se ejecuta en un cambio de la señal clk, cuando =1
    			q<=d;
    		end if;
    	end process;
    end arch_dff;
    
    
    • Public Snippets
    • Channels Snippets